for (File algFile : examplesDir.listFiles(new FileFilter() {
@Override
public boolean accept(File pathname) { return pathname.isFile() && pathname.getName().endsWith(".alg"); }
})) {
try {
Config config = new Config(new InputStreamReader(new FileInputStream(algFile), "UTF-8"));
String contentSource = config.get("content.source", null);
if (contentSource != null) { Class.forName(contentSource); }
config.set("work.dir", new File(TEMP_DIR,"work").getAbsolutePath());
config.set("content.source", MockContentSource.class.getName());
String dir = config.get("content.source", null);
if (dir != null) { Class.forName(dir); }
config.set("directory", RAMDirectory.class.getName());
if (config.get("line.file.out", null) != null) {
config.set("line.file.out", new File(TEMP_DIR,"o.txt").getAbsolutePath());
}
if (config.get("query.maker", null) != null) {
Class.forName(config.get("query.maker", null));
config.set("query.maker", MockQueryMaker.class.getName());
}
PerfRunData data = new PerfRunData(config);
new Algorithm(data);
} catch (Throwable t) {
t.printStackTrace();