private static void addToPsiFileList(@NotNull PsiDirectory psiDirectory,
                                       @NotNull List<? super PsiFile> fileList,
                                       boolean isRecursive,
                                       @NotNull Path outputDirectoryName) throws IOException {
    if (!psiDirectory.isValid()) {
      return;
    }

    Collections.addAll(fileList, psiDirectory.getFiles());
    generateIndexHtml(psiDirectory, isRecursive, outputDirectoryName);
    if (isRecursive) {
      for (PsiDirectory directory : psiDirectory.getSubdirectories()) {
        addToPsiFileList(directory, fileList, true, outputDirectoryName);
      }
    }
  }
private static void addToPsiFileList(@NotNull PsiDirectory psiDirectory,
                                       @NotNull List<? super PsiFile> fileList,
                                       boolean isRecursive,
                                       @NotNull Path outputDirectoryName)