public abstract class AbstractFileChunkedStrategy<T> extends java.lang.Object implements FileChunkedStrategy<T>
FileChunkedStrategy. Only the
FileChunkedStrategy.chunkFile(FileChannel)method needs to be implemented, but child classes can also override
afterWrite(NettyContext)to add custom cleanup. The pipeline preparation and cleanup involves adding and removing the
NettyPipeline.ChunkedWriterhandler if it was not already present. It will be added before
NettyPipeline.ReactiveBridgeor last, if the bridge handler is not present.
|Constructor and Description|
|Modifier and Type||Method and Description|
Additional cleanup to perform at the end of
Once the file has been written, allows to clean the pipeline (see
Allow for preparing the pipeline (eg.
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public final void preparePipeline(NettyContext context)
NettyContextis provided and can be used to get the
This adds a ChunkedWriter to the pipeline to extract chunks from the
ChunkedInput that the strategy produces. This step
is skipped if the handler is already present, and the placement of the handler
depends on the presence of the ReactiveBridge handler (see
public final void cleanupPipeline(NettyContext context)
FileChunkedStrategy.preparePipeline(NettyContext)) and do other operations.
This removes the ChunkedWriter handler if it was added by this strategy. It then