@Test public void testDeleteQuietly() throws Exception { FileUtils.deleteDirectoryQuietly(null); File doesNotExist = new File(tmp.getRoot(), "abc"); FileUtils.deleteDirectoryQuietly(doesNotExist); File cannotDeleteParent = tmp.newFolder(); File cannotDeleteChild = new File(cannotDeleteParent, "child"); try { assumeTrue(cannotDeleteChild.createNewFile()); assumeTrue(cannotDeleteParent.setWritable(false)); assumeTrue(cannotDeleteChild.setWritable(false)); FileUtils.deleteDirectoryQuietly(cannotDeleteParent); } finally { cannotDeleteParent.setWritable(true); cannotDeleteChild.setWritable(true); } }
public static void deleteDirectoryQuietly(File directory) { if (directory == null) { return; } try { deleteDirectory(directory); } catch (Exception ignored) {} }
FileUtils { public static void deleteDirectoryQuietly(File directory) { if (directory == null) { return; } try { deleteDirectory(directory); } catch (Exception ignored) {} } }
FileUtils { public static void deleteDirectoryQuietly(File directory) { if (directory == null) { return; } try { deleteDirectory(directory); } catch (Exception ignored) {} } private  FileUtils(); }
FileUtils { public static void deleteDirectoryQuietly(File directory) { if (directory == null) { return; } try { deleteDirectory(directory); } catch (Exception ignored) {} } private  FileUtils(); static void writeCompletely(WritableByteChannel channel, ByteBuffer src); static String getRandomFilename(final String prefix); static String readFile(File file, String charsetName); static String readFileUtf8(File file); static void writeFile(File file, String contents, String encoding); static void writeFileUtf8(File file, String contents); static byte[] readAllBytes(java.nio.file.Path path); static void deleteFileOrDirectory(File file); static void deleteDirectory(File directory); static void deleteDirectoryQuietly(File directory); static void cleanDirectory(File directory); static boolean deletePathIfEmpty(FileSystem fileSystem, Path path); static void copy(Path sourcePath, Path targetPath, boolean executable); static Path compressDirectory(Path directory, Path target); static Path expandDirectory(Path file, Path targetDirectory); }
FileUtils { public static void deleteDirectoryQuietly(File directory) { if (directory == null) { return; } try { deleteDirectory(directory); } catch (Exception ignored) {} } private  FileUtils(); static void writeCompletely(WritableByteChannel channel, ByteBuffer src); static String getRandomFilename(final String prefix); static String readFile(File file, String charsetName); static String readFileUtf8(File file); static void writeFile(File file, String contents, String encoding); static void writeFileUtf8(File file, String contents); static byte[] readAllBytes(java.nio.file.Path path); static void deleteFileOrDirectory(File file); static void deleteDirectory(File directory); static void deleteDirectoryQuietly(File directory); static void cleanDirectory(File directory); static boolean deletePathIfEmpty(FileSystem fileSystem, Path path); static void copy(Path sourcePath, Path targetPath, boolean executable); static Path compressDirectory(Path directory, Path target); static Path expandDirectory(Path file, Path targetDirectory);  }