diff --git a/src/main/java/ru/bclib/util/PathUtil.java b/src/main/java/ru/bclib/util/PathUtil.java index d48e37a0..8062218d 100644 --- a/src/main/java/ru/bclib/util/PathUtil.java +++ b/src/main/java/ru/bclib/util/PathUtil.java @@ -24,7 +24,6 @@ public class PathUtil { return child.equals(parent); } - /** * A simple directory walker that ignores dot-files * @@ -33,6 +32,18 @@ public class PathUtil { * for each visited file */ public static void fileWalker(File path, Consumer pathConsumer) { + fileWalker(path, true, pathConsumer); + } + + /** + * A simple directory walker that ignores dot-files + * + * @param path The path where you want to start + * @param recursive if {@code false}, only the {@code path} is traversed + * @param pathConsumer The consumer called for each valid file. The consumer will get an absolute {@link Path}-Object + * for each visited file + */ + public static void fileWalker(File path, boolean recursive, Consumer pathConsumer) { if (!path.exists()) return; for (final File f : path.listFiles()) { if (f.getName()