code: public void waitForCompletion()
              throws AmazonClientException, AmazonServiceException, InterruptedException {
          try {
              Object result = null;
              while (!monitor.isDone() || result == null) {
                  Future<?> f = monitor.getFuture();
                  result = f.get();
              }
          } catch (ExecutionException e) {
              rethrowExecutionException(e);
  
          }
      }
docs: Waits for this transfer to complete. This is a blocking call; the current
  thread is suspended until this transfer completes.
  
  @throws AmazonClientException
  If any errors were encountered in the client while making the
  request or handling the response.
  @throws AmazonServiceException
  If any errors occurred in Amazon S3 while processing the
  request.
  @throws InterruptedException
  If this thread is interrupted while waiting for the transfer
  to complete.