code: public <T extends AbstractPutObjectRequest> T withMetadata(
              ObjectMetadata metadata) {
          setMetadata(metadata);
          @SuppressWarnings("unchecked") T t = (T)this;
          return t;
      }
docs: Sets the optional metadata instructing Amazon S3 how to handle the
  uploaded data (e.g. custom user metadata, hooks for specifying content
  type, etc.). Returns this {@link AbstractPutObjectRequest}, enabling additional method
  calls to be chained together.
  <p>
  If uploading from an input stream,
  <b>always</b> specify metadata with the content size set. Otherwise the
  contents of the input stream have to be buffered in memory before
  being sent to Amazon S3. This can cause very negative performance
  impacts.
  </p>
  
  @param metadata
  The optional metadata instructing Amazon S3 how to handle the
  uploaded data (e.g. custom user metadata, hooks for specifying
  content type, etc.).
  
  @return This {@link AbstractPutObjectRequest}, enabling additional method
  calls to be chained together.
  
  @see AbstractPutObjectRequest#getMetadata()
  @see AbstractPutObjectRequest#setMetadata(ObjectMetadata)