From: amwaterhouse Date: Fri, 27 Oct 2006 16:13:09 +0000 (+0000) Subject: Rename old properties file before writing new X-Git-Tag: Release_2_2~208 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=f174f7c02a8357a4a35c6254739c98fafcca757a;p=jalview.git Rename old properties file before writing new --- diff --git a/src/jalview/bin/Cache.java b/src/jalview/bin/Cache.java index 32a11e2..77178a1 100755 --- a/src/jalview/bin/Cache.java +++ b/src/jalview/bin/Cache.java @@ -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;