Top Description Fields Constructors Methods
org.eclipse.jetty.client

public Class PathRequestContent

extends PathContentSource
implements Content
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.client.Request.Content, org.eclipse.jetty.io.Content.Source
Imports
java.io.IOException, java.nio.file.Path, org.eclipse.jetty.io.ByteBufferPool, org.eclipse.jetty.io.content.PathContentSource

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.

Field Summary

Modifier and TypeField and Description
private final String

Constructor Summary

AccessConstructor and Description
public
public
PathRequestContent(Path filePath, int bufferSize)

public
PathRequestContent(String contentType, Path filePath)

public
PathRequestContent(String contentType, Path filePath, int bufferSize)

public
PathRequestContent(String contentType, Path filePath, ByteBufferPool bufferPool)

Method Summary

Modifier and TypeMethod and Description
public String
Inherited from org.eclipse.jetty.io.content.PathContentSource:
demandfailgetBufferSizegetLengthgetPathisReadCompleteisUseDirectByteBuffersopenreadreadrewindsetBufferSizesetUseDirectByteBuffers

Field Detail

contentTypeback to summary
private final String contentType

Constructor Detail

PathRequestContentback to summary
public PathRequestContent(Path filePath) throws IOException
PathRequestContentback to summary
public PathRequestContent(Path filePath, int bufferSize) throws IOException
PathRequestContentback to summary
public PathRequestContent(String contentType, Path filePath) throws IOException
PathRequestContentback to summary
public PathRequestContent(String contentType, Path filePath, int bufferSize) throws IOException
PathRequestContentback to summary
public PathRequestContent(String contentType, Path filePath, ByteBufferPool bufferPool) throws IOException

Method Detail

getContentTypeback to summary
public String getContentType()

Overrides default org.eclipse.jetty.client.Request.Content.getContentType.

Returns:String

Doc from org.eclipse.jetty.client.Request.Content.getContentType.

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

Annotations
@Override