public static long directorySize(Path path) {
    try (var walker = Files.walk(path)) {
      return walker
        .filter(Files::isRegularFile)
        .mapToLong(FileUtils::fileSize)
        .sum();
    } catch (IOException e) {
      return 0;
    }
  }
Returns the directory usage of all files until {@code path} or 0 if missing/inaccessible.
planetiler-core/src/main/java/com/onthegomap/planetiler/util/FileUtils.java