Rename old properties file before writing new
authoramwaterhouse <Andrew Waterhouse>
Fri, 27 Oct 2006 16:13:09 +0000 (16:13 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 27 Oct 2006 16:13:09 +0000 (16:13 +0000)
src/jalview/bin/Cache.java

index 32a11e2..77178a1 100755 (executable)
@@ -288,9 +288,12 @@ public class Cache
     {
         try
         {
+            File oldFile = new File(propertiesFile);
+            oldFile.renameTo(new File(propertiesFile+"#"));
             FileOutputStream out = new FileOutputStream(propertiesFile);
             applicationProperties.store(out, "---JalviewX Properties File---");
             out.close();
+            oldFile.delete();
         }
         catch (Exception ex)
         {  System.out.println("Error saving properties: "+ex);  }
@@ -312,10 +315,10 @@ public class Cache
             Logger lvclient = Logger.getLogger("org.vamsas");
             lvclient.setLevel(Level.toLevel(Cache.getDefault("logs.Vamsas.Level",
                 Level.INFO.toString())));
-            
+
             lvclient.addAppender(log.getAppender("JalviewLogger"));
             // Tell the user that debug is enabled
-            lvclient.debug("Jalview Vamsas Client Debugging Output Follows.");     
+            lvclient.debug("Jalview Vamsas Client Debugging Output Follows.");
           }
         } catch (Exception e) {
           vamsasJarsArePresent=0;