HerdFileUtils extends FileUtils { public static void deleteFileIgnoreException(File file) { try { FileUtils.forceDelete(file); } catch (Exception e) { LOGGER.warn(String.format("Failed to delete \"%s\" file.", file), e); } }  static void verifyFileExistsAndReadable(File file); static void cleanDirectoryIgnoreException(File directory); static void deleteDirectoryIgnoreException(File directory); static void deleteFileIgnoreException(File file); static final long BYTES_PER_GB; }
@Test public void testDeleteFileIgnoreException() throws IOException { File testFile = createLocalFile(localTempPath.toString(), "SOME_FILE", FILE_SIZE_1_KB); HerdFileUtils.deleteFileIgnoreException(testFile); assertFalse(testFile.exists()); assertTrue(localTempPath.toFile().exists()); }