code: public R uploadAndFinish(InputStream in, IOUtil.ProgressListener progressListener) throws X, DbxException, IOException {
          try {
              try {
                  httpUploader.setProgressListener(progressListener);
                  httpUploader.upload(in);
              } catch (IOUtil.ReadException ex) {
                  throw ex.getCause();
              } catch (IOException ex) {
                  // write exceptions and everything else is a Network I/O problem
                  throw new NetworkIOException(ex);
              }
  
              return finish();
          } finally {
              close();
          }
      }
docs: This method is the same as {@link #uploadAndFinish(InputStream, long)} except for it allow
  tracking the upload progress.
  
  @param in {@code InputStream} containing data to upload
  @param progressListener {@code OUtil.ProgressListener} to track the upload progress.
  Only support  OKHttpRequester and StandardHttpRequester.
  
  @return Response from server
  
  @throws X if the server sent an error response for the request
  @throws DbxException if an error occurs uploading the data or reading the response
  @throws IOException if an error occurs reading the input stream.
  @throws IllegalStateException if this uploader has already been closed (see {@link #close}) or finished (see {@link #finish})