private boolean listScripts(final Player player, List<String> filterTerm) {
// *.groovy scripts is in data/script/
final File dirGroovy = new File(scriptDir);
// *.class scripts is in data/script/games/stendhal/server/script/
final File dirClasses = new File(scriptDir+"games/stendhal/server/script/");
final String[] scriptsGroovy = dirGroovy.list(new FilenameFilter() {
public boolean accept(final File dir, final String name) {
return (name.endsWith(".groovy") && (name.indexOf('$') == -1));
}
});
final String[] scriptsJava = dirClasses.list(new FilenameFilter(){
public boolean accept(final File dir, final String name) {
// remove filenames with '$' inside because they are inner classes
return (name.endsWith(".class") && (name.indexOf('$') == -1));
}
});