@Test public void emptyIfExists() throws IOException { assertThat(DirectoryHelper.emptyIfExists(root.toPath().resolve("not-existing")), is(false)); assertThat(DirectoryHelper.emptyIfExists(root.toPath()), is(true)); assertThat(root, exists()); assertThat(root, isDirectory()); assertThat(root, isEmptyDirectory()); }
public static boolean emptyIfExists(final Path dir) throws IOException { checkNotNull(dir); if (Files.exists(dir)) { empty(dir); return true; } else { return false; } }
DirectoryHelper { public static boolean emptyIfExists(final Path dir) throws IOException { checkNotNull(dir); if (Files.exists(dir)) { empty(dir); return true; } else { return false; } } }
DirectoryHelper { public static boolean emptyIfExists(final Path dir) throws IOException { checkNotNull(dir); if (Files.exists(dir)) { empty(dir); return true; } else { return false; } } private  DirectoryHelper(); }
DirectoryHelper { public static boolean emptyIfExists(final Path dir) throws IOException { checkNotNull(dir); if (Files.exists(dir)) { empty(dir); return true; } else { return false; } } private  DirectoryHelper(); static void mkdir(final Path dir); static void mkdir(final File dir); static File mkdir(final File parent, final String child); static void clean(final Path dir); static boolean cleanIfExists(final Path dir); static void empty(final Path dir); static boolean emptyIfExists(final Path dir); static void delete(final Path dir); static void delete(final Path dir, @Nullable final Predicate<Path> excludeFilter); static boolean deleteIfExists(final Path dir); static boolean deleteIfExists(final Path dir, @Nullable final Predicate<Path> excludeFilter); static void copy(final Path from, final Path to); static void copy(final Path from, final Path to, @Nullable final Predicate<Path> excludeFilter); static boolean copyIfExists(final Path from, final Path to); static boolean copyIfExists(final Path from, final Path to, @Nullable final Predicate<Path> excludeFilter); static void move(final Path from, final Path to); static boolean moveIfExists(final Path from, final Path to); static void copyDeleteMove(final Path from, final Path to, @Nullable final Predicate<Path> excludeFilter); static boolean copyDeleteMoveIfExists(final Path from,
                                               final Path to,
                                               @Nullable final Predicate<Path> excludeFilter); static void apply(final Path from, final Function<Path, FileVisitResult> func); static void applyToFiles(final Path from, final Function<Path, FileVisitResult> func); }
DirectoryHelper { public static boolean emptyIfExists(final Path dir) throws IOException { checkNotNull(dir); if (Files.exists(dir)) { empty(dir); return true; } else { return false; } } private  DirectoryHelper(); static void mkdir(final Path dir); static void mkdir(final File dir); static File mkdir(final File parent, final String child); static void clean(final Path dir); static boolean cleanIfExists(final Path dir); static void empty(final Path dir); static boolean emptyIfExists(final Path dir); static void delete(final Path dir); static void delete(final Path dir, @Nullable final Predicate<Path> excludeFilter); static boolean deleteIfExists(final Path dir); static boolean deleteIfExists(final Path dir, @Nullable final Predicate<Path> excludeFilter); static void copy(final Path from, final Path to); static void copy(final Path from, final Path to, @Nullable final Predicate<Path> excludeFilter); static boolean copyIfExists(final Path from, final Path to); static boolean copyIfExists(final Path from, final Path to, @Nullable final Predicate<Path> excludeFilter); static void move(final Path from, final Path to); static boolean moveIfExists(final Path from, final Path to); static void copyDeleteMove(final Path from, final Path to, @Nullable final Predicate<Path> excludeFilter); static boolean copyDeleteMoveIfExists(final Path from,
                                               final Path to,
                                               @Nullable final Predicate<Path> excludeFilter); static void apply(final Path from, final Function<Path, FileVisitResult> func); static void applyToFiles(final Path from, final Function<Path, FileVisitResult> func); static final Set<FileVisitOption> DEFAULT_FILE_VISIT_OPTIONS; }