code: public void cancelDownload(final boolean hideWindowImmediately) {
          logger.info("Cancel of download requested");
          _cancelled = true;
  
          if (hideWindowImmediately && _downloadProgressWindow != null) {
              WidgetUtils.invokeSwingAction(_downloadProgressWindow::close);
          }
      }
docs: Cancels the file download.
  
  @param hideWindowImmediately
  determines if the download progress window should be hidden
  immediately or only when the progress of cancelling the
  download has occurred gracefully.