private void deleteOldBackups(List<File> backupFiles) {
/* We're creating a new back-up, so must leave one space available */
while (backupFiles.size() > (fMaxBackupsCount - 1)) {
File fileToDelete = backupFiles.remove(backupFiles.size() - 1);
if (!fileToDelete.delete()) {
throw new PersistenceException("Failed to delete file: " + fileToDelete); //$NON-NLS-1$
}
}
}