public static List<Path> walkPathWithPattern(Path basePath, String pattern,
    Function<Path, List<Path>> walkZipFile) {
    PathMatcher matcher = basePath.getFileSystem().getPathMatcher("glob:" + pattern);

    try {
      if (FileUtils.hasExtension(basePath, "zip")) {
        try (
          var zipFs = FileSystems.newFileSystem(basePath);
          var walkStream = FileUtils.walkFileSystem(zipFs)
        ) {
          return walkStream
            .filter(p -> p.getFileName() != null && matcher.matches(p.getFileName()))
            .toList();
        }
      } 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)))
            .flatMap(path -> {
              if (FileUtils.hasExtension(path, "zip")) {
                return walkZipFile.apply(path).stream();
              } else {
                return Stream.of(path);
              }
            })
            .toList();
        }
      } else {
        throw new IllegalArgumentException("No files matching " + basePath + "/" + pattern);
      }
    } catch (IOException exc) {
      throw new UncheckedIOException(exc);
    }
  }
Returns list of paths matching {@param pattern} within {@param basePath}.
<p>
If {@param basePath} is a directory, then {@param walkZipFile} will be invoked for each matching {@code .zip} file
found. This function should return paths of interest within the zip file.

@param basePath    file path to recursively walk, either a directory or ZIP archive.
@param pattern     pattern to match filenames against, as described in {@link FileSystem#getPathMatcher(String)}.
@param walkZipFile callback function to recurse into matching {@code .zip} files.
planetiler-core/src/main/java/com/onthegomap/planetiler/util/FileUtils.java