import java.util.*;
import java.io.*;
+// FIXME: Update for new api
+
/** A JS interface to a Java '.properties' file; very crude */
public class PropertyFile extends JS {
- private final Properties p = new Properties();
+ /*private final Properties p = new Properties();
private final Hash cache = new Hash(10, 3);
private File f;
}
public void put(Object key, Object val) throws JSExn {
try {
- p.put(prefix + "." + escape(toString(key)), toString(val));
+ p.put(prefix + (prefix.equals("") ? "" : ".") + escape(toString(key)), toString(val));
File fnew = new File(f.getName() + ".new");
FileOutputStream fo = new FileOutputStream(fnew);
p.save(fo, "");
}
public static String escape(String s) {
- return s.replaceAll("\\\\", "\\\\\\\\").replaceAll(".", "\\\\.").replaceAll("=","\\\\="); }
+ return s.replaceAll("\\\\", "\\\\\\\\").replaceAll("\\.", "\\\\.").replaceAll("=","\\\\="); }
public PropertyFile(File f) throws IOException { this.f = f; this.p.load(new FileInputStream(f)); }
public void put(Object key, Object val) throws JSExn { new Minion("").put(key, val); }
public Enumeration keys() throws JSExn { return new Minion("").keys(); }
Object ret = p.get(toString(key));
if (ret != null) return ret;
return new Minion(escape(toString(key)));
- }
+ }*/
}