mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-18 22:45:23 +02:00
[367424] [dstore] upload mechanism should provide backups of files
This commit is contained in:
parent
868e39217c
commit
de60a4e93c
1 changed files with 4 additions and 1 deletions
|
@ -96,7 +96,10 @@ public class ByteStreamHandler implements IByteStreamHandler
|
||||||
String n = file.getName();
|
String n = file.getName();
|
||||||
File backupFile = new File(parent, '.' + n + '~');
|
File backupFile = new File(parent, '.' + n + '~');
|
||||||
_dataStore.trace("Backing up as "+backupFile.getAbsolutePath()); //$NON-NLS-1$
|
_dataStore.trace("Backing up as "+backupFile.getAbsolutePath()); //$NON-NLS-1$
|
||||||
file.renameTo(backupFile);
|
if(!file.renameTo(backupFile) && backupFile.exists()) {
|
||||||
|
backupFile.delete();
|
||||||
|
file.renameTo(backupFile);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue