diff --git a/planetiler-core/src/main/java/com/onthegomap/planetiler/util/FileUtils.java b/planetiler-core/src/main/java/com/onthegomap/planetiler/util/FileUtils.java index 431cc3ddea..b9ea755d15 100644 --- a/planetiler-core/src/main/java/com/onthegomap/planetiler/util/FileUtils.java +++ b/planetiler-core/src/main/java/com/onthegomap/planetiler/util/FileUtils.java @@ -85,7 +85,10 @@ public static List walkPathWithPattern(Path basePath, String pattern, } else if (Files.isDirectory(basePath)) { try (var walk = Files.walk(basePath, FileVisitOption.FOLLOW_LINKS)) { return walk - .filter(path -> matcher.matches(path.getFileName()) || matcher.matches(basePath.relativize(path))) + .filter(path -> { + System.err.println(" " + basePath + " " + basePath.relativize(path) + " " + matcher.matches(basePath.relativize(path)); + return matcher.matches(path.getFileName()) || matcher.matches(basePath.relativize(path)); + }) .flatMap(path -> { if (FileUtils.hasExtension(path, "zip")) { return walkZipFile.apply(path).stream(); diff --git a/planetiler-core/src/test/java/com/onthegomap/planetiler/util/GlobTest.java b/planetiler-core/src/test/java/com/onthegomap/planetiler/util/GlobTest.java index 7033f6068c..df66bb8813 100644 --- a/planetiler-core/src/test/java/com/onthegomap/planetiler/util/GlobTest.java +++ b/planetiler-core/src/test/java/com/onthegomap/planetiler/util/GlobTest.java @@ -44,9 +44,9 @@ void testWalkPathWithPattern() throws IOException { Files.writeString(path, "test"); assertEquals(List.of(path), Glob.of(tmpDir).resolve("a", "*", "c.txt").find()); System.err.println(Glob.of(tmpDir).resolve("*", "*", "c.txt")); - System.err.println(Glob.of(tmpDir).resolve("*", "*", "c.txt").find()); - System.err.println(Glob.of(tmpDir).resolve("**", "c.txt").find()); - System.err.println(Glob.of(tmpDir).resolve("*", "b", "c.txt").find()); + System.err.println(Glob.of(tmpDir).resolve("*", "*", "c.txt").find()); // nope + System.err.println(Glob.of(tmpDir).resolve("**", "c.txt").find()); // ok + System.err.println(Glob.of(tmpDir).resolve("*", "b", "c.txt").find()); // nada assertEquals(List.of(path), Glob.of(tmpDir).resolve("*", "*", "c.txt").find()); assertEquals(List.of(path), Glob.of(tmpDir).resolve("a", "b", "c.txt").find()); }