public static boolean createDirectoryIfNotExists(String promptPrefix, String directoryPath, boolean promptUser) {
    Path dir = Paths.get(directoryPath);

    if (!Files.exists(dir)) {
      if (promptUser) {
        String ide = ApplicationNamesInfo.getInstance().getFullProductName();
        String message = JavaUiBundle.message("prompt.project.wizard.directory.does.not.exist", promptPrefix, dir, ide);
        int answer = Messages.showOkCancelDialog(message, JavaUiBundle.message("title.directory.does.not.exist"), IdeBundle.message("button.create"), IdeBundle.message("button.cancel"), Messages.getQuestionIcon());
        if (answer != Messages.OK) {
          return false;
        }
      }

      try {
        Files.createDirectories(dir);
      }
      catch (IOException e) {
        Logger.getInstance(ProjectWizardUtil.class).warn(e);
        Messages.showErrorDialog(IdeBundle.message("error.failed.to.create.directory", dir), CommonBundle.getErrorTitle());
        return false;
      }
    }

    if (!isWritable(dir)) {
      Messages.showErrorDialog(JavaUiBundle.message("error.directory.read.only", dir), CommonBundle.getErrorTitle());
      return false;
    }

    return true;
  }
public static boolean createDirectoryIfNotExists(String promptPrefix, String directoryPath, boolean promptUser)