Class PathRequestContent

java.lang.Object
org.eclipse.jetty.io.content.PathContentSource
org.eclipse.jetty.client.util.PathRequestContent
All Implemented Interfaces:
Request.Content, org.eclipse.jetty.io.Content.Source

public class PathRequestContent extends org.eclipse.jetty.io.content.PathContentSource implements Request.Content

A Request.Content for files using JDK 7's java.nio.file APIs.

It is possible to specify a buffer size used to read content from the stream, by default 4096 bytes, whether the buffer should be direct or not, and a RetainableByteBufferPool from which ByteBuffers will be acquired to read from the Path.

  • Constructor Details

  • Method Details

    • getContentType

      public String getContentType()
      Specified by:
      getContentType in interface Request.Content
      Returns:
      the content type string such as "application/octet-stream" or "application/json;charset=UTF8", or null if the Content-Type header must not be set