private static @NotNull Path constructOutputDirectory(@NotNull PsiDirectory directory, @NotNull Path outDir) throws IOException {
    String qualifiedName = PsiDirectoryFactory.getInstance(directory.getProject()).getQualifiedName(directory, false);
    Path dir = outDir;
    if (!qualifiedName.isEmpty()) {
      dir = dir.resolve(qualifiedName.replace('.', File.separatorChar));
    }
    Files.createDirectories(dir);
    return dir;
  }
private static @NotNull Path constructOutputDirectory(@NotNull PsiDirectory directory, @NotNull Path outDir)