From f174f7c02a8357a4a35c6254739c98fafcca757a Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Fri, 27 Oct 2006 16:13:09 +0000 Subject: [PATCH] Rename old properties file before writing new --- src/jalview/bin/Cache.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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; -- 1.7.10.2