public static void invoke(Interpreter env) {
for (String command : commandNames) {
InputStream input = LoadAllCommands.class.getResourceAsStream("/org/jsurveylib/model/script/interpreter/commands/" + command + ".bsh");
if (input == null) {
throw new EvaluationException("Could not load this command: " + command + ".bsh");
}
try {
env.eval(new InputStreamReader(input, "UTF8"));
} catch (EvalError e) {
throw new EvaluationException(e);
} catch (UnsupportedEncodingException e) {
throw new EvaluationException(e);
}
}
}