Util { public static void deleteQuietly(File f) { if ((f != null) && f.exists()) { try { FileUtils.forceDelete(f); } catch (IOException e) { log.warn(StringUtils.EMPTY, e); } } } private  Util(); static String toRealPagePath(String pagePath); static String toUrlPagePath(String pagePath); static String simplifyForUrl(String text); static String join(Object o, String delimiter); static void deleteQuietly(File f); static RuntimeException toRuntimeException(Throwable t); static File toFile(File baseDir, String path); static void closeQuietly(Closeable c); static Map<String, String> parseParameters(String params); static String serialize(Serializable s); static T deserialize(String s, Class<T> clazz);  }
@Test(expected=None.class) public void deleteQuietly() throws IOException { File dir = tempDir.getRoot(); File file = new File(dir, "test.txt"); FileUtils.touch(file); assertTrue(file.isFile()); Util.deleteQuietly(file); assertFalse(file.exists()); Util.deleteQuietly(dir); assertFalse(dir.exists()); }
@Test(expected=None.class) public void deleteQuietlyMustAcceptNull() { Util.deleteQuietly(null); }