use beanshell to execute a scripts from a specific folder (error no such file or directory) -


i added library bsh android project (jar file), create file executor.bsh under scripts(a folder have created under project) used code below

private final interpreter i= new interpreter(); i.source("scripts/executor.bsh"); 

i got error:

no such file or directory

help !!

interpreter.source(..) looks file, have jar entry. however, can still use with:

try (reader script = new inputstreamreader(getclass().getclassloader().getresourceasstream("scripts/executor.bsh")) {     interpreter in = new interpreter(script, system.in, system.out, system.err, false);     // script loaded     // interpreter here. } 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -