|
|
|
@ -206,10 +206,10 @@ public final class serverFileUtils {
|
|
|
|
|
return (Hashtable) prop;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void saveMap(File f, Map props, String comment) throws IOException {
|
|
|
|
|
public static void saveMap(File file, Map props, String comment) throws IOException {
|
|
|
|
|
PrintWriter pw = null;
|
|
|
|
|
try {
|
|
|
|
|
pw = new PrintWriter(new BufferedOutputStream(new FileOutputStream(f)));
|
|
|
|
|
File tf = new File(file.toString() + "." + (System.currentTimeMillis() % 1000));
|
|
|
|
|
pw = new PrintWriter(new BufferedOutputStream(new FileOutputStream(tf)));
|
|
|
|
|
pw.println("# " + comment);
|
|
|
|
|
Iterator i = props.entrySet().iterator();
|
|
|
|
|
String key, value;
|
|
|
|
@ -221,9 +221,9 @@ public final class serverFileUtils {
|
|
|
|
|
pw.println(key + "=" + value);
|
|
|
|
|
}
|
|
|
|
|
pw.println("# EOF");
|
|
|
|
|
} finally {
|
|
|
|
|
if (pw!=null)try{pw.close();}catch(Exception e){}
|
|
|
|
|
}
|
|
|
|
|
pw.close();
|
|
|
|
|
file.delete();
|
|
|
|
|
tf.renameTo(file);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|