commons-configuration is gone to commons-collections
[mir.git] / source / mir / config / MirPropertiesConfiguration.java
index eea7bf0..52c3fc1 100755 (executable)
@@ -33,6 +33,7 @@ package mir.config;
 import multex.Exc;
 import multex.Failure;
 
+import org.apache.commons.collections.ExtendedProperties;
 import org.apache.commons.configuration.PropertiesConfiguration;
 
 import java.io.File;
@@ -49,7 +50,7 @@ import javax.servlet.ServletContext;
 /**
  * @author idefix
  */
-public class MirPropertiesConfiguration extends PropertiesConfiguration {
+public class MirPropertiesConfiguration extends ExtendedProperties {
   private static MirPropertiesConfiguration instance;
   private static ServletContext context;
   private static String contextPath;
@@ -121,7 +122,7 @@ public class MirPropertiesConfiguration extends PropertiesConfiguration {
 
     while (iterator.hasNext()) {
       String key = (String) iterator.next();
-      Object o = this.getString(key);
+      Object o = this.getProperty(key);
 
       if (o == null) {
         o = new Object();
@@ -175,11 +176,16 @@ public class MirPropertiesConfiguration extends PropertiesConfiguration {
    * @see org.apache.commons.configuration.Configuration#getString(java.lang.String)
    */
   public String getString(String key) {
-    if (super.getString(key) == null) {
+       Object object = getProperty(key);       
+       if(object != null){
+               if (object instanceof String) {
+                       return (String)object;
+               } else {
+                       return object.toString();
+               }
+       } else {
       return new String();
     }
-
-    return super.getString(key);
   }
 
   /**