From: Sasa M. <sa...@us...> - 2004-07-13 09:39:20
|
Update of /cvsroot/jrobin/src/org/jrobin/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2452/org/jrobin/core Modified Files: RrdToolkit.java Log Message: Resolved problem with .bak files removal Index: RrdToolkit.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/core/RrdToolkit.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** RrdToolkit.java 20 May 2004 10:29:33 -0000 1.9 --- RrdToolkit.java 13 Jul 2004 09:39:09 -0000 1.10 *************** *** 256,260 **** File dest = new File(destPath); if (saveBackup) { ! String backupPath = destPath + ".bak"; File backup = new File(backupPath); deleteFile(backup); --- 256,260 ---- File dest = new File(destPath); if (saveBackup) { ! String backupPath = getBackupPath(destPath); File backup = new File(backupPath); deleteFile(backup); *************** *** 269,272 **** --- 269,280 ---- } + private static String getBackupPath(String destPath) { + String backupPath = destPath; + do { + backupPath += ".bak"; + } while(new File(backupPath).exists()); + return backupPath; + } + /** * Sets datasource heartbeat to a new value. |