Fix a wrong location of the contact list backup file

cusax-fix
Benoit Pradelle 19 years ago
parent e84a998f34
commit a079b2e2e2

@ -408,7 +408,16 @@ private void storeContactList0() throws IOException
out.close();
// note the end of the transfert
backup.renameTo(new File(contactlistFile.getName() + ".bak"));
File final_backup = new File(contactlistFile.getAbsolutePath()
+ ".bak");
// this should not happen, but if it's the case, the rename
// operation can fail
if (final_backup.exists()) {
final_backup.delete();
}
backup.renameTo(final_backup);
// really write the modification
OutputStream stream = new FileOutputStream(contactlistFile);
@ -417,7 +426,7 @@ private void storeContactList0() throws IOException
stream.close();
// once done, delete the backup file
backup.delete();
final_backup.delete();
}
}

Loading…
Cancel
Save