From: Niels Erik G. Nielsen Date: Sat, 16 Mar 2013 00:57:50 +0000 (-0400) Subject: Fixes config file path resolution issues X-Git-Tag: v0.0.7~201 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=0298f47d427f8f6afc3d2d67c5a1529cf41f6b8e;p=mkjsf-moved-to-github.git Fixes config file path resolution issues --- diff --git a/src/main/java/com/indexdata/pz2utils4jsf/config/Configuration.java b/src/main/java/com/indexdata/pz2utils4jsf/config/Configuration.java index adab4bb..67106c3 100644 --- a/src/main/java/com/indexdata/pz2utils4jsf/config/Configuration.java +++ b/src/main/java/com/indexdata/pz2utils4jsf/config/Configuration.java @@ -9,6 +9,12 @@ import org.apache.log4j.Logger; import com.indexdata.masterkey.config.MissingMandatoryParameterException; import com.indexdata.pz2utils4jsf.utils.Utils; +/** + * Represents a configuration as a set of key-value pairs + * + * @author Niels Erik + * + */ public class Configuration implements Serializable { private static final long serialVersionUID = -6801241975338182197L; @@ -62,7 +68,7 @@ public class Configuration implements Serializable { } public String getConfigFilePath() { - return get("configfilepath","nopathgiven"); + return get("configpath","nopathgiven"); } public Map getConfigMap() { diff --git a/src/main/java/com/indexdata/pz2utils4jsf/config/Mk2ConfigReader.java b/src/main/java/com/indexdata/pz2utils4jsf/config/Mk2ConfigReader.java index 430cc73..554f931 100644 --- a/src/main/java/com/indexdata/pz2utils4jsf/config/Mk2ConfigReader.java +++ b/src/main/java/com/indexdata/pz2utils4jsf/config/Mk2ConfigReader.java @@ -22,6 +22,13 @@ import com.indexdata.pz2utils4jsf.errors.ConfigurationException; import com.indexdata.pz2utils4jsf.utils.Utils; import static com.indexdata.pz2utils4jsf.utils.Utils.nl; +/** + * Reads configuration from a MasterKey configuration scheme + * + * + * @author Niels Erik + * + */ @Named @SessionScoped @Alternative public class Mk2ConfigReader implements ConfigurationReader { @@ -58,7 +65,7 @@ public class Mk2ConfigReader implements ConfigurationReader { try { ModuleConfiguration moduleConfig = mkConfigContext.getModuleConfiguration(configurable.getModuleName()); config.addAll(configurable.getDefaults(),moduleConfig.getConfigMap()); - config.set("configpath", mkConfigContext.getConfigFileLocation().getConfigFilePath()); + config.set("configpath", moduleConfig.getConfigFilePath()); } catch (IOException e) { throw new ConfigurationException(Mk2ConfigReader.class + " could not read configuration for '"+ configurable.getModuleName() + "': "+e.getMessage(),e); }