public static LinkedHashSet<String> collectRelativePaths(Path root) throws IOException {
    LinkedHashSet<String> result = new LinkedHashSet<>();

    Files.walkFileTree(root, new SimpleFileVisitor<>() {
      @Override
      public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) {
        if (dir != root) {
          result.add(root.relativize(dir).toString().replace('\\', '/') + '/');
        }
        return FileVisitResult.CONTINUE;
      }

      @Override
      public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
        result.add(root.relativize(file).toString().replace('\\', '/'));
        return FileVisitResult.CONTINUE;
      }
    });

    return result;
  }
public static LinkedHashSet<String> collectRelativePaths(Path root)