From ec402db38fd68a8b25f3d669d6748a8dcdf49caa Mon Sep 17 00:00:00 2001 From: idfx Date: Sun, 16 Mar 2003 16:40:26 +0000 Subject: [PATCH] a small bugfix --- source/mir/config/MirPropertiesConfiguration.java | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/source/mir/config/MirPropertiesConfiguration.java b/source/mir/config/MirPropertiesConfiguration.java index 9c2c020c..359ad467 100755 --- a/source/mir/config/MirPropertiesConfiguration.java +++ b/source/mir/config/MirPropertiesConfiguration.java @@ -30,21 +30,19 @@ */ 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); -- 2.11.0