fix: exception if default work files don't exist

This commit is contained in:
reger 2012-12-22 23:03:39 +01:00
parent 9e4033f229
commit 0148f1bb8c

View File

@ -339,12 +339,14 @@ public final class Switchboard extends serverSwitch {
this.workPath.mkdirs();
// if default work files exist, copy them (don't overwrite existing!)
File defaultWorkPath = new File("defaults/data/work");
for (String fs: defaultWorkPath.list()) {
if (defaultWorkPath.list() != null) {
for (String fs : defaultWorkPath.list()) {
File wf = new File(this.workPath, fs);
if (!wf.exists()) {
Files.copy(new File(defaultWorkPath, fs), wf);
}
}
}
this.log.logConfig("Work Path: " + this.workPath.toString());
this.dictionariesPath =