*/
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
*/
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();
}
public Map allSettings() {
Iterator iterator = this.getKeys();
Map returnMap = new HashMap();
-
while (iterator.hasNext()) {
String key = (String) iterator.next();
Object o = this.getProperty(key);