code: private void updateStateAndNotifyListener(DownloadState downloadState) throws IOException {
      this.downloadState = downloadState;
      if (progressListener != null) {
        progressListener.progressChanged(this);
      }
    }
docs: Sets the download state and notifies the progress listener.
  
  @param downloadState value to set to