a small bugfix
authoridfx <idfx>
Sun, 16 Mar 2003 16:40:26 +0000 (16:40 +0000)
committeridfx <idfx>
Sun, 16 Mar 2003 16:40:26 +0000 (16:40 +0000)
source/mir/config/MirPropertiesConfiguration.java

index 9c2c020..359ad46 100755 (executable)
  */
 package mir.config;
 
-import multex.Exc;
-import multex.Failure;
-
-import org.apache.commons.collections.ExtendedProperties;
-
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
-
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
-
 import javax.servlet.ServletContext;
 
+import multex.Exc;
+import multex.Failure;
+
+import org.apache.commons.collections.ExtendedProperties;
+
 
 /**
  * @author idefix
@@ -71,8 +69,13 @@ public class MirPropertiesConfiguration extends ExtendedProperties {
    */
   private MirPropertiesConfiguration(ServletContext ctx, String ctxPath)
     throws IOException {
-    super(ctx.getRealPath("/WEB-INF/etc/") + "/config.properties",
-      ctx.getRealPath("/WEB-INF/") + "/default.properties");
+    //loading the defaults-config
+    super(ctx.getRealPath("/WEB-INF/") + "/default.properties");
+    //loading the user-config
+    ExtendedProperties userConfig = 
+       new ExtendedProperties(ctx.getRealPath("/WEB-INF/etc/") + "/config.properties");
+    //merging them to one config while overriding the defaults
+    this.combine(userConfig);
     addProperty("Home", ctx.getRealPath("/WEB-INF/") + "/");
     checkMissing();
   }
@@ -118,7 +121,6 @@ public class MirPropertiesConfiguration extends ExtendedProperties {
   public Map allSettings() {
     Iterator iterator = this.getKeys();
     Map returnMap = new HashMap();
-
     while (iterator.hasNext()) {
       String key = (String) iterator.next();
       Object o = this.getProperty(key);