AsyncEntityProducer implementation that generates a data stream from the content at a Path.
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private final ByteBuffer | |
| private final AtomicReference | |
| private final boolean | |
| private final ContentType | |
| private boolean | |
| private final AtomicReference | |
| private final Path | |
| private final long | |
| private final OpenOption[] |
| Access | Constructor and Description |
|---|---|
| public | PathEntityProducer(final Path file, final ContentType contentType, final boolean chunked, final OpenOption... openOptions)
|
| public | |
| public | PathEntityProducer(final Path file, final int bufferSize, final ContentType contentType, final boolean chunked, final OpenOption... openOptions)
|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | available()
Implements org. |
| public void | failed(final Exception
the cause of the failure. cause)Implements org. |
| public String | getContentEncoding()
Implements org. |
| public long | getContentLength()
Implements org. |
| public String | getContentType()
Implements org. |
| public Exception | |
| public Set | getTrailerNames()
Implements org. |
| public boolean | isChunked()
Implements org. |
| public boolean | isRepeatable()
Implements org. ResourceHolder#releaseResources().
|
| public void | produce(final DataStreamChannel
the data channel capable to accepting more data. dataStreamChannel)Implements org. |
| public void |
| BUFFER_SIZE | back to summary |
|---|---|
| private static final int BUFFER_SIZE | |
| byteBuffer | back to summary |
|---|---|
| private final ByteBuffer byteBuffer | |
| channelRef | back to summary |
|---|---|
| private final AtomicReference<SeekableByteChannel> channelRef | |
| chunked | back to summary |
|---|---|
| private final boolean chunked | |
| contentType | back to summary |
|---|---|
| private final ContentType contentType | |
| eof | back to summary |
|---|---|
| private boolean eof | |
| exception | back to summary |
|---|---|
| private final AtomicReference<Exception> exception | |
| file | back to summary |
|---|---|
| private final Path file | |
| length | back to summary |
|---|---|
| private final long length | |
| openOptions | back to summary |
|---|---|
| private final OpenOption[] openOptions | |
| PathEntityProducer | back to summary |
|---|---|
| public PathEntityProducer(final Path file, final ContentType contentType, final boolean chunked, final OpenOption... openOptions) throws IOException | |
| PathEntityProducer | back to summary |
|---|---|
| public PathEntityProducer(final Path file, final ContentType contentType, final OpenOption... openOptions) throws IOException | |
| PathEntityProducer | back to summary |
|---|---|
| public PathEntityProducer(final Path file, final int bufferSize, final ContentType contentType, final boolean chunked, final OpenOption... openOptions) throws IOException | |
| PathEntityProducer | back to summary |
|---|---|
| public PathEntityProducer(final Path file, final OpenOption... openOptions) throws IOException | |
| available | back to summary |
|---|---|
| public int available() Implements org. Doc from org. Returns the number of bytes immediately available for output. This method can be used as a hint to control output events of the underlying I/O session.
| |
| failed | back to summary |
|---|---|
| public void failed(final Exception cause) Implements org. Doc from org. Triggered to signal a failure in data generation. | |
| getContentEncoding | back to summary |
|---|---|
| public String getContentEncoding() Implements org. Doc from org. Returns content encoding of the entity, if known.
| |
| getContentLength | back to summary |
|---|---|
| public long getContentLength() Implements org. Doc from org. Returns length of the entity, if known.
| |
| getContentType | back to summary |
|---|---|
| public String getContentType() Implements org. Doc from org. Returns content type of the entity, if known.
| |
| getException | back to summary |
|---|---|
| public Exception getException() | |
| getTrailerNames | back to summary |
|---|---|
| public Set Implements org. Doc from org. Preliminary declaration of trailing headers.
| |
| isChunked | back to summary |
|---|---|
| public boolean isChunked() Implements org. Doc from org. Returns chunked transfer hint for this entity. The behavior of wrapping entities is implementation dependent, but should respect the primary purpose.
| |
| isRepeatable | back to summary |
|---|---|
| public boolean isRepeatable() Implements org. Doc from org. Determines whether the producer can consistently produce the same content
after invocation of
| |
| produce | back to summary |
|---|---|
| public void produce(final DataStreamChannel dataStreamChannel) throws IOException Implements org. Doc from org. Triggered to signal the ability of the underlying data channel to accept more data. The data producer can choose to write data immediately inside the call or asynchronously at some later point.
| |
| releaseResources | back to summary |
|---|---|
| public void releaseResources() Implements org.
| |