Interface BodyPart
public interface BodyPart
A body part entity.
-
Method Summary
Modifier and TypeMethodDescriptionAggregates thisBodyPart
.aggregate
(EventExecutor executor) Aggregates thisBodyPart
.(Advanced users only) Aggregates thisBodyPart
.aggregateWithPooledObjects
(EventExecutor executor, ByteBufAllocator alloc) (Advanced users only) Aggregates thisBodyPart
.static BodyPartBuilder
builder()
Returns a newBodyPartBuilder
.content()
Returns the reactive representation of the part content.filename()
Returns the file name.headers()
Returns HTTP part headers.name()
Returns the control name.static BodyPart
of
(ContentDisposition contentDisposition, HttpData content) static BodyPart
of
(ContentDisposition contentDisposition, MediaType contentType, HttpData content) static BodyPart
of
(ContentDisposition contentDisposition, MediaType contentType, CharSequence content) Returns a new UTF-8-encodedBodyPart
using the specifiedContentDisposition
,MediaType
andCharSequence
.static BodyPart
of
(ContentDisposition contentDisposition, MediaType contentType, org.reactivestreams.Publisher<? extends HttpData> publisher) static BodyPart
of
(ContentDisposition contentDisposition, CharSequence content) static BodyPart
of
(ContentDisposition contentDisposition, org.reactivestreams.Publisher<? extends HttpData> publisher) static BodyPart
of
(HttpHeaders headers, HttpData content) static BodyPart
of
(HttpHeaders headers, CharSequence content) static BodyPart
of
(HttpHeaders headers, org.reactivestreams.Publisher<? extends HttpData> publisher) writeTo
(Path path, EventExecutor eventExecutor, ExecutorService blockingTaskExecutor, OpenOption... options) writeTo
(Path path, OpenOption... options)
-
Method Details
-
of
-
of
static BodyPart of(ContentDisposition contentDisposition, MediaType contentType, CharSequence content) Returns a new UTF-8-encodedBodyPart
using the specifiedContentDisposition
,MediaType
andCharSequence
. -
of
-
of
-
of
-
of
-
of
static BodyPart of(ContentDisposition contentDisposition, org.reactivestreams.Publisher<? extends HttpData> publisher) -
of
static BodyPart of(ContentDisposition contentDisposition, MediaType contentType, org.reactivestreams.Publisher<? extends HttpData> publisher) -
of
static BodyPart of(HttpHeaders headers, org.reactivestreams.Publisher<? extends HttpData> publisher) -
builder
Returns a newBodyPartBuilder
. -
headers
HttpHeaders headers()Returns HTTP part headers. -
content
Returns the reactive representation of the part content. -
writeTo
CompletableFuture<Void> writeTo(Path path, EventExecutor eventExecutor, ExecutorService blockingTaskExecutor, OpenOption... options) Writes thisBodyPart
to the givenPath
withOpenOption
s. If theOpenOption
s are not specified, they default toStandardOpenOption.CREATE
,StandardOpenOption.TRUNCATE_EXISTING
andStandardOpenOption.WRITE
.- Parameters:
path
- thePath
to write toeventExecutor
- theEventExecutor
to subscribe to this given publisherblockingTaskExecutor
- theExecutorService
to which blocking tasks are submitted to handle file I/O events and write operationsoptions
- theOpenOption
s specifying how the file is opened- Returns:
- a
CompletableFuture
to handle asynchronous result
-
writeTo
Writes thisBodyPart
to the givenPath
withOpenOption
s. If theOpenOption
s are not specified, they default toStandardOpenOption.CREATE
,StandardOpenOption.TRUNCATE_EXISTING
andStandardOpenOption.WRITE
.- Parameters:
path
- thePath
to write tooptions
- theOpenOption
s specifying how the file is opened- Returns:
- a
CompletableFuture
to handle asynchronous result
-
aggregate
CompletableFuture<AggregatedBodyPart> aggregate()Aggregates thisBodyPart
. The returnedCompletableFuture
will be notified when theBodyPart
is received fully. -
aggregate
Aggregates thisBodyPart
. The returnedCompletableFuture
will be notified when theBodyPart
is received fully. -
aggregateWithPooledObjects
(Advanced users only) Aggregates thisBodyPart
. The returnedCompletableFuture
will be notified when theBodyPart
is received fully.AggregatedHttpObject.content()
will return a pooled object, and the caller must ensure to release it. If you don't know what this means, useaggregate()
. -
aggregateWithPooledObjects
CompletableFuture<AggregatedBodyPart> aggregateWithPooledObjects(EventExecutor executor, ByteBufAllocator alloc) (Advanced users only) Aggregates thisBodyPart
. The returnedCompletableFuture
will be notified when theBodyPart
is received fully.AggregatedHttpObject.content()
will return a pooled object, and the caller must ensure to release it. If you don't know what this means, useaggregate()
. -
name
Returns the control name.- Returns:
- the
name
parameter of the"content-disposition"
header, ornull
if not present.
-
filename
Returns the file name.- Returns:
- the
filename
parameter of the"content-disposition"
header, ornull
if not present.
-