found = true;
try {
if (file.getName().endsWith("mtwl")) {
wordLists.put(list, new MultiTreeWordList(file.getAbsolutePath()));
} else {
wordLists.put(list, new TreeWordList(file.getAbsolutePath()));
}
} catch (IOException e) {
Logger.getLogger(this.getClass().getName()).log(Level.SEVERE,
"Error reading word list", e);
found = false;
}
break;
}
}
if (!found) {
InputStream stream = ClassLoader.getSystemResourceAsStream(list);
if (stream != null) {
found = true;
try {
if (list.endsWith(".mtwl"))
wordLists.put(list, new MultiTreeWordList(stream, list));
else
wordLists.put(list, new TreeWordList(stream, list));
} catch (IOException e) {
Logger.getLogger(this.getClass().getName()).log(Level.SEVERE,
"Error reading word list from classpath", e);
found = false;
}