Unlink an old file before moving the new file over it
This is unlikely to be relevant to this bug, but just in case. Bug: 7274972 Change-Id: I56b31b377af16cc2c15ceb90a19792bed3aab367
This commit is contained in:
parent
01d9b1f17a
commit
c15726482e
1 changed files with 1 additions and 0 deletions
|
@ -200,6 +200,7 @@ public final class BinaryDictionaryFileDumper {
|
||||||
outputStream.flush();
|
outputStream.flush();
|
||||||
outputStream.close();
|
outputStream.close();
|
||||||
final File finalFile = new File(finalFileName);
|
final File finalFile = new File(finalFileName);
|
||||||
|
finalFile.delete();
|
||||||
if (!outputFile.renameTo(finalFile)) {
|
if (!outputFile.renameTo(finalFile)) {
|
||||||
throw new IOException("Can't move the file to its final name");
|
throw new IOException("Can't move the file to its final name");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue