public static void createParentDirectories(Path... paths) {
    for (var path : paths) {
      if (path != null) {
        try {
          if (Files.isDirectory(path) && !Files.exists(path)) {
            Files.createDirectories(path);
          } else {
            Path parent = path.getParent();
            if (parent != null && !Files.exists(parent)) {
              Files.createDirectories(parent);
            }
          }
        } catch (IOException e) {
          throw new IllegalStateException("Unable to create parent directories " + path, e);
        }
      }
    }
  }
Ensures all parent directories of each path in {@code paths} exist.

@throws IllegalStateException if an error occurs
planetiler-core/src/main/java/com/onthegomap/planetiler/util/FileUtils.java