AdeFileUtils { public static void deleteFileOrLog(File file) { if (!file.delete()) { logger.warn(FAILED_DELETING_FILE + file.getPath()); } } private  AdeFileUtils(); static void copyFile(File source, File target); static BufferedReader openLogFile(File file); static InputStream openLogFileAsInputStream(File file); static void deleteFile(File file); static void deleteFileOrLog(File file); static void createDir(File target); static void createDirs(File target); static boolean deleteRecursiveOrLog(File path);  }
@Test public void testDeleteFileOrLogFileNotExist() throws AdeUsageException { final File emptyFile = new File("fakefile"); AdeFileUtils.deleteFileOrLog(emptyFile); assertFalse("Verify the file still does not exist.", emptyFile.exists()); }
@Test public void testDeleteFileOrLog() throws AdeUsageException, IOException { final File targetFile = temporaryFolder.newFile("file"); AdeFileUtils.deleteFileOrLog(targetFile); assertFalse("Verify the file no longer exists.", targetFile.exists()); }