1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-01 14:15:23 +02:00

[367424] [dstore] upload mechanism should provide backups of files

This commit is contained in:
David McKnight 2012-03-20 20:12:00 +00:00
parent 868e39217c
commit de60a4e93c

View file

@ -96,7 +96,10 @@ public class ByteStreamHandler implements IByteStreamHandler
String n = file.getName();
File backupFile = new File(parent, '.' + n + '~');
_dataStore.trace("Backing up as "+backupFile.getAbsolutePath()); //$NON-NLS-1$
file.renameTo(backupFile);
if(!file.renameTo(backupFile) && backupFile.exists()) {
backupFile.delete();
file.renameTo(backupFile);
}
}
}