aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/knowcenter/wag/egov/egiz/cfg/SettingsReader.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/knowcenter/wag/egov/egiz/cfg/SettingsReader.java')
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/cfg/SettingsReader.java25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/cfg/SettingsReader.java b/src/main/java/at/knowcenter/wag/egov/egiz/cfg/SettingsReader.java
index 231da06..31ca5e1 100644
--- a/src/main/java/at/knowcenter/wag/egov/egiz/cfg/SettingsReader.java
+++ b/src/main/java/at/knowcenter/wag/egov/egiz/cfg/SettingsReader.java
@@ -694,14 +694,14 @@ public class SettingsReader implements Serializable
public static synchronized void initialize(String configdir, String tmpdir) {
- boolean defaultConfigDeployed = false;
+ String defaultConfigDeployedTo = null;
// resolve work directory
// configuration explicitely given ?
if (configdir == null) {
// configuration via system property ?
- logger_.debug("No configuration directory given. Looking for system property \"" + Constants.CONFIG_SYSTEM_PROPERTY + "\".");
- configdir = System.getProperty(Constants.CONFIG_SYSTEM_PROPERTY);
+ logger_.debug("No configuration directory given. Looking for system property \"" + Constants.CONFIG_DIR_SYSTEM_PROPERTY + "\".");
+ configdir = System.getProperty(Constants.CONFIG_DIR_SYSTEM_PROPERTY);
if (configdir == null) {
// configuration via user's home directory ?
@@ -712,17 +712,20 @@ public class SettingsReader implements Serializable
}
configdir = assertFileSeparator(userHome) + Constants.USERHOME_CONFIG_FOLDER;
try {
- defaultConfigDeployed = ConfigUtils.deployDefaultConfiguration(configdir, false);
+ defaultConfigDeployedTo = ConfigUtils.deployDefaultConfiguration(configdir, false);
} catch (ConfigUtilsException e) {
throw new RuntimeException(e);
}
- if (defaultConfigDeployed) {
- logger_.info("** Default configuration successfully deployed to the current user's home. **");
+ if (defaultConfigDeployedTo != null) {
+ logger_.info("** Default configuration successfully deployed to \"" + defaultConfigDeployedTo + "\" **");
} else {
- logger_.debug("Default configuration NOT deployed because to the current user's home because it already exists.");
+ logger_.debug("Default configuration has NOT been deployed. Maybe the configuration already exists.");
}
} else {
logger_.debug("Configuration set by system property.");
+ if (tmpdir == null) {
+ tmpdir = configdir;
+ }
}
} else {
logger_.debug("Configuration path explicitely set.");
@@ -768,10 +771,12 @@ public class SettingsReader implements Serializable
logger_.debug(" configuration path = \"" + CONFIG_PATH + "\"");
logger_.debug(" certstore path = \"" + CERT_PATH + "\"");
logger_.debug(" temporary path = \"" + TMP_PATH + "\"");
- if (defaultConfigDeployed) {
- logger_.debug(" default configuration was deployed to the current user's home directory ");
- }
logger_.debug(StringUtils.repeat("*", length + 25));
+ if (defaultConfigDeployedTo != null) {
+ logger_.debug("** Default configuration successfully deployed to \"" + defaultConfigDeployedTo + "\" **");
+ }
+ logger_.debug("Setting system property \"" + Constants.CONFIG_DIR_SYSTEM_PROPERTY + "\" to \"" + configdirFile.getPath() + "\".");
+ System.setProperty(Constants.CONFIG_DIR_SYSTEM_PROPERTY, configdirFile.getPath());
}
public static void initialize(String base_dir)