private static void generateIndexHtml(PsiDirectory psiDirectory, boolean recursive, @NotNull Path outDir)
    throws IOException {
    Path indexHtmlName = constructOutputDirectory(psiDirectory, outDir).resolve("index.html");
    String title = PsiDirectoryFactory.getInstance(psiDirectory.getProject()).getQualifiedName(psiDirectory, true);
    try (BufferedWriter writer = Files.newBufferedWriter(indexHtmlName)) {
      writer.write("<html><head><title>" + title + "</title></head><body>");
      if (recursive) {
        PsiDirectory[] directories = psiDirectory.getSubdirectories();
        for (PsiDirectory directory : directories) {
          writer.write("<a href=\"" + directory.getName() + "/index.html\"><b>" + directory.getName() + "</b></a><br />");
        }
      }
      PsiFile[] files = psiDirectory.getFiles();
      for (PsiFile file : files) {
        if (!(file instanceof PsiBinaryFile)) {
          writer.write("<a href=\"" + getHTMLFileName(file) + "\">" + file.getVirtualFile().getName() + "</a><br />");
        }
      }
      writer.write("</body></html>");
    }
  }
private static void generateIndexHtml(PsiDirectory psiDirectory, boolean recursive, @NotNull Path outDir)