public class ConcatenatedAsyncContentProvider extends AbstractAsyncContentProvider
AsyncContentProvider implementation that concatenates multiple
AsyncContentProvider instances. The success listener is called when the content of the
last wrapped provider is processed. In case the instance of this class is closed, all wrapped
content providers will be closed.AbstractAsyncContentProvider.OnlyProcessedHandlingAsyncContentListener| Constructor and Description |
|---|
ConcatenatedAsyncContentProvider(Optional<MediaType> contentType,
AsyncContentProvider... contentProviders)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
doClose() |
Optional<Long> |
getContentLength()
The size of the data that is provided or
Optional.empty() if the length is unknown in
advance. |
Optional<MediaType> |
getContentType()
The media type of the content or
Optional.empty() if the media type is unknown. |
protected void |
provideNextChunk(Consumer<ByteBuffer> provideCallback) |
close, getFailure, handleErrorFromInput, handleSuccess, isClosed, onContent, onError, onSuccesspublic ConcatenatedAsyncContentProvider(Optional<MediaType> contentType, AsyncContentProvider... contentProviders)
contentType - The optional content type that this instance provides. See getContentType().contentProviders - The providers whose processing are concatenated with each other.protected void doClose()
doClose in class AbstractAsyncContentProviderpublic Optional<Long> getContentLength()
AsyncContentProviderOptional.empty() if the length is unknown in
advance.public Optional<MediaType> getContentType()
AsyncContentProviderOptional.empty() if the media type is unknown.protected void provideNextChunk(Consumer<ByteBuffer> provideCallback)
provideNextChunk in class AbstractAsyncContentProviderCopyright © 2011–2019 Everit Kft.. All rights reserved.