*/
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 {
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; }
if (name!=null ) {
String returnValue="";
try {
- return ostoreConf.getString(name);
+ return ostoreConf.getProperty(name);
}
catch (MissingResourceException e) {
System.err.println("ObjectStore: " + e.toString());