commons-configuration is gone to commons-collections
authoridfx <idfx>
Thu, 13 Mar 2003 21:33:21 +0000 (21:33 +0000)
committeridfx <idfx>
Thu, 13 Mar 2003 21:33:21 +0000 (21:33 +0000)
lib/README.txt
lib/commons-collections-2.1.jar [new file with mode: 0755]
lib/commons-configuration-1.0-dev.jar [deleted file]
source/mir/config/MirPropertiesConfiguration.java

index c2c58dd..69c5ee2 100755 (executable)
@@ -40,15 +40,14 @@ todo       : check if necessary / update to version 1.1.1
              necessary?
 
 
-commons-configuration-1.0-dev
+commons-collections
 ------------------------------------------------
-version    : 1.0-dev
+version    : 2.1
 url        : http://jakarta.apache.org/commons/
 description: needed for parsing the configuration 
-             properties file
-todo       : moved into the Commons Collections as 
-             ExtendedProperties / replace with
-             commons-collections
+             properties file and provides more useful collections
+             like a LRUCache
+todo       : 
 
 
 commons-net20030111
diff --git a/lib/commons-collections-2.1.jar b/lib/commons-collections-2.1.jar
new file mode 100755 (executable)
index 0000000..f66c6d2
Binary files /dev/null and b/lib/commons-collections-2.1.jar differ
diff --git a/lib/commons-configuration-1.0-dev.jar b/lib/commons-configuration-1.0-dev.jar
deleted file mode 100755 (executable)
index c0f1011..0000000
Binary files a/lib/commons-configuration-1.0-dev.jar and /dev/null differ
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);
   }
 
   /**