public static void downloadContentToFileWithProgressSynchronously(
    @Nullable Project project,
    @NotNull final String url,
    @NotNull @NlsContexts.ProgressTitle String progressTitle,
    @NotNull final File outputFile,
    @NotNull final String userName,
    @NotNull final String repositoryName,
    final boolean retryOnError) throws GeneratorException
  {
    Outcome<File> outcome = DownloadUtil.provideDataWithProgressSynchronously(
      project,
      progressTitle,
      LangBundle.message("progress.text.downloading.zip.archive", DownloadUtil.CONTENT_LENGTH_TEMPLATE),
      () -> {
        ProgressIndicator progress = ProgressManager.getInstance().getProgressIndicator();
        downloadAtomically(progress, url, outputFile, userName, repositoryName);
        return outputFile;
      }, () -> {
        if (!retryOnError) {
          return false;
        }
        return IOExceptionDialog.showErrorDialog(LangBundle.message("dialog.title.download.error"),
                                                 LangBundle.message("text.can.not.download", url));
      }
    );
    File out = outcome.get();
    if (out != null) {
      return;
    }
    Exception e = outcome.getException();
    if (e != null) {
      throw new GeneratorException(LangBundle.message("dialog.message.can.fetch.content.from", url), e);
    }
    throw new GeneratorException(LangBundle.message("dialog.message.download.was.cancelled"));
  }
public static void downloadContentToFileWithProgressSynchronously(
    @Nullable Project project,
    @NotNull final String url,
    @NotNull @NlsContexts.ProgressTitle String progressTitle,
    @NotNull final File outputFile,
    @NotNull final String userName,
    @NotNull final String repositoryName,
    final boolean retryOnError)