@Test public void deleteBackupFile() throws IOException { File file = new File(FileSystem.createTemporaryFile()); new FileTuple(new File(file.getPath() + ".log"), file).delete(); assertThat(file).doesNotExist(); }
public void delete() { if (original.isFile() && !original.delete()) { InternalLogger.log(Level.WARN, "Failed to delete log file '" + original + "'"); } if (!backup.equals(original) && backup.isFile() && !backup.delete()) { InternalLogger.log(Level.WARN, "Failed to delete backup file '" + backup + "'"); } }
FileTuple { public void delete() { if (original.isFile() && !original.delete()) { InternalLogger.log(Level.WARN, "Failed to delete log file '" + original + "'"); } if (!backup.equals(original) && backup.isFile() && !backup.delete()) { InternalLogger.log(Level.WARN, "Failed to delete backup file '" + backup + "'"); } } }
FileTuple { public void delete() { if (original.isFile() && !original.delete()) { InternalLogger.log(Level.WARN, "Failed to delete log file '" + original + "'"); } if (!backup.equals(original) && backup.isFile() && !backup.delete()) { InternalLogger.log(Level.WARN, "Failed to delete backup file '" + backup + "'"); } } FileTuple(final File original, final File backup); }
FileTuple { public void delete() { if (original.isFile() && !original.delete()) { InternalLogger.log(Level.WARN, "Failed to delete log file '" + original + "'"); } if (!backup.equals(original) && backup.isFile() && !backup.delete()) { InternalLogger.log(Level.WARN, "Failed to delete backup file '" + backup + "'"); } } FileTuple(final File original, final File backup); File getOriginal(); File getBackup(); long getLastModified(); void delete(); }
FileTuple { public void delete() { if (original.isFile() && !original.delete()) { InternalLogger.log(Level.WARN, "Failed to delete log file '" + original + "'"); } if (!backup.equals(original) && backup.isFile() && !backup.delete()) { InternalLogger.log(Level.WARN, "Failed to delete backup file '" + backup + "'"); } } FileTuple(final File original, final File backup); File getOriginal(); File getBackup(); long getLastModified(); void delete();  }