public boolean exists(Path p) {
    if (p == null) {
      return false;
    }
    if (format() != Format.FILES) {
      return Files.exists(p);
    } else {
      if (!Files.exists(p)) {
        return false;
      }
      // file-archive exists only if it has any contents
      try (Stream<Path> paths = Files.list(p)) {
        return paths.findAny().isPresent();
      } catch (IOException e) {
        throw new UncheckedIOException(e);
      }
    }
  }
@param p path to the archive
@return {@code true} if the archive already exists, {@code false} otherwise.
planetiler-core/src/main/java/com/onthegomap/planetiler/archive/TileArchiveConfig.java