public interface AggregatedHttpFile extends HttpFile
HttpFile which has its attributes and content readily available.
Unlike HttpFile, an AggregatedHttpFile does not raise an IOException for
readAttributes()readHeaders()HttpFile.read(Executor, ByteBufAllocator)aggregate(Executor)aggregateWithPooledObjects(Executor, ByteBufAllocator)content() which gives you an immediate access to the file's
content.| Modifier and Type | Method and Description |
|---|---|
default CompletableFuture<AggregatedHttpFile> |
aggregate(Executor fileReadExecutor)
Converts this file into an
AggregatedHttpFile. |
default CompletableFuture<AggregatedHttpFile> |
aggregateWithPooledObjects(Executor fileReadExecutor,
io.netty.buffer.ByteBufAllocator alloc)
Converts this file into an
AggregatedHttpFile. |
HttpData |
content()
Returns the content of the file.
|
HttpFileAttributes |
readAttributes()
Returns the attributes of the file.
|
ResponseHeaders |
readHeaders()
Returns the attributes of this file as
ResponseHeaders, which could be useful for building
a response for a HEAD request. |
HttpFileAttributes readAttributes()
readAttributes in interface HttpFilenull if the file does not exist.ResponseHeaders readHeaders()
ResponseHeaders, which could be useful for building
a response for a HEAD request.readHeaders in interface HttpFilenull if the file does not exist.HttpData content()
null if the file does not exist.default CompletableFuture<AggregatedHttpFile> aggregate(Executor fileReadExecutor)
HttpFileAggregatedHttpFile.aggregate in interface HttpFilefileReadExecutor - the Executor which will perform the read operations against the fileCompletableFuture which will complete when the aggregation process is finished, or
a CompletableFuture successfully completed with this, if this file is already
an AggregatedHttpFile.default CompletableFuture<AggregatedHttpFile> aggregateWithPooledObjects(Executor fileReadExecutor, io.netty.buffer.ByteBufAllocator alloc)
HttpFileAggregatedHttpFile. content() will
return a pooled object, and the caller must ensure to release it. If you don't know what this means,
use HttpFile.aggregate(Executor).aggregateWithPooledObjects in interface HttpFilefileReadExecutor - the Executor which will perform the read operations against the filealloc - the ByteBufAllocator which will allocate the content bufferCompletableFuture which will complete when the aggregation process is finished, or
a CompletableFuture successfully completed with this, if this file is already
an AggregatedHttpFile.Copyright © 2020 LeanCloud. All rights reserved.