From 1eac16f95618fc4bc1e90b5d44cc94252647f136 Mon Sep 17 00:00:00 2001 From: tknall Date: Tue, 10 Jun 2008 10:47:02 +0000 Subject: Manual deployment of pdf-as configuration (commandline parameter -ddc) considers the system property pdf-as.work-dir. Internal default configuration updated. log4.properties within the workdir is now being considered using the api. git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@280 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- .../wag/egov/egiz/cfg/SettingsReader.java | 25 +++++++++++++--------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'src/main/java/at/knowcenter/wag/egov/egiz/cfg') 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) -- cgit v1.2.3