Commit 622868a7 authored by Locatelli's avatar Locatelli
Browse files

Correct bug

VirtualHome was setting after properties reading
parent 7e0a4abb
......@@ -121,7 +121,7 @@ public class ConfigManager {
private boolean mainClient = true;
private String clientType;
private String localFilesDirectory = DEFAULT_LOCAL_FILES_DIRECTORY;
private static String localFilesDirectory = DEFAULT_LOCAL_FILES_DIRECTORY;
/**
* @return the unique instance of this class
......@@ -140,9 +140,10 @@ public class ConfigManager {
}
public static void initInstance() {
public static void initInstance(String virtualHomeValue) {
if (instance == null) {
instance = new ConfigManager();
setLocalFilesDirectory(virtualHomeValue);
instance.init();
}
}
......@@ -640,12 +641,14 @@ public class ConfigManager {
return localFilesDirectory;
}
public void setLocalFilesDirectory(String localFilesDirectory) {
if (!new File(localFilesDirectory).exists()) {
// Directory does not exist: create it
File file = new File(localFilesDirectory);
file.mkdir();
private static void setLocalFilesDirectory(String tmp) {
if (tmp.isEmpty() == false) {
if (!new File(tmp).exists()) {
// Directory does not exist: create it
File file = new File(tmp);
file.mkdir();
}
localFilesDirectory = tmp;
}
this.localFilesDirectory = localFilesDirectory;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment