contains only admin templates which should not be changed by users
[mir.git] / source / mir / storage / store / ObjectStore.java
index ab83ab1..1d93f22 100755 (executable)
@@ -62,9 +62,12 @@ package mir.storage.store;
  */
 
 import java.util.*;
+import java.io.BufferedInputStream;
+import java.io.FileInputStream;
 import javax.servlet.http.*;
 import javax.servlet.*;
 import mir.misc.Logfile;
+import mir.misc.MirConfig;
 
 public class ObjectStore {
 
@@ -72,12 +75,21 @@ public class ObjectStore {
        private final static HashMap        containerMap=new HashMap(); // StoreContainerType/StoreContainer
        private static Logfile              storeLog;
        private static long                 storeHit=0,storeMiss=0;
-  private ResourceBundle              ostoreConf;
+  private Properties              ostoreConf;
 
        private ObjectStore() {
-    ostoreConf = ResourceBundle.getBundle("objectstore");
-    if ( ostoreConf == null )
-      System.err.println("FATAL: could not find objectstore.properties");
+    String confName=MirConfig.getProp("Home")+"etc/objectstore.properties";
+    Properties conf = new Properties();
+    try {
+        conf.load( new BufferedInputStream(new FileInputStream(confName)));
+    }
+    catch ( java.io.FileNotFoundException fnfe ) {
+        System.err.println("could not read config file. not found: "+confName);
+    }
+    catch ( java.io.IOException ioex ) {
+        System.err.println("could not read config file: "+confName);
+    }
+    ostoreConf = conf;
        }
        public static ObjectStore getInstance() { return INSTANCE; }
 
@@ -190,7 +202,7 @@ public class ObjectStore {
     if (name!=null ) {
       String returnValue="";
       try {
-        return ostoreConf.getString(name);
+        return ostoreConf.getProperty(name);
       }
       catch (MissingResourceException e) {
         System.err.println("ObjectStore: " + e.toString());