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