Fixed configuration not found and does not create it automatically

This commit is contained in:
PeratX 2017-06-03 20:29:15 +08:00
parent 0e180537e8
commit c23f4fe190

View File

@ -110,6 +110,14 @@ public class Daedalus extends Application {
if (getExternalFilesDir(null) != null) {
rulesPath = getExternalFilesDir(null).getPath() + "/rules/";
configPath = getExternalFilesDir(null).getPath() + "/config.json";
File configDir = new File(rulesPath);
if (!configDir.isDirectory()) {
Logger.warning("Configuration directory is not a directory. Delete result: " + String.valueOf(configDir.delete()));
}
if (!configDir.exists()) {
Logger.debug("Configuration directory does not exist. Create result: " + String.valueOf(configDir.mkdirs()));
}
}
initData();