Class PathRequestContent
java.lang.Object
org.eclipse.jetty.io.content.PathContentSource
org.eclipse.jetty.client.PathRequestContent
- All Implemented Interfaces:
Request.Content, Content.Source
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
ByteBufferPool from which ByteBuffers will be acquired
to read from the Path.
-
Nested Class Summary
Nested classes/interfaces inherited from interface Content.Source
Content.Source.Factory -
Constructor Summary
ConstructorsConstructorDescriptionPathRequestContent(String contentType, Path filePath) PathRequestContent(String contentType, Path filePath, int bufferSize) PathRequestContent(String contentType, Path filePath, ByteBufferPool bufferPool) PathRequestContent(String contentType, Path filePath, ByteBufferPool.Sized sizedBufferPool) PathRequestContent(Path filePath) PathRequestContent(Path filePath, int bufferSize) -
Method Summary
Methods inherited from class PathContentSource
demand, fail, getBufferSize, getLength, getPath, isReadComplete, isUseDirectByteBuffers, open, read, read, rewind, setBufferSize, setUseDirectByteBuffers
-
Constructor Details
-
PathRequestContent
- Throws:
IOException
-
PathRequestContent
- Throws:
IOException
-
PathRequestContent
- Throws:
IOException
-
PathRequestContent
- Throws:
IOException
-
PathRequestContent
public PathRequestContent(String contentType, Path filePath, ByteBufferPool bufferPool) throws IOException - Throws:
IOException
-
PathRequestContent
-
-
Method Details
-
getContentType
- Specified by:
getContentTypein interfaceRequest.Content- Returns:
- the value of the
Content-Typeheader for the request content, such astext/html;charset=utf-8orapplication/json, ornullto use the value fromHttpClient.getDefaultRequestContentType()
-