am 20f07e33: Merge "Unlink an old file before moving the new file over it" into jb-mr1-dev

* commit '20f07e335df4155df2176e6124389a98e25aecf7':
  Unlink an old file before moving the new file over it
main
Ken Wakasa 2012-10-04 15:36:07 -07:00 committed by Android Git Automerger
commit 37c8f8b510
1 changed files with 1 additions and 0 deletions

View File

@ -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");
} }