java.lang.Object
io.helidon.media.multipart.ReadableBodyPart
- All Implemented Interfaces:
BodyPart
Readable body part entity.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder class for creatingBodyPartinstances. -
Method Summary
Modifier and TypeMethodDescription<T> TConverts the part content into an instance of the requested type.static ReadableBodyPart.Builderbuilder()Create a new builder instance.content()Get the reactive representation of the part content.voiddrain()Release all chunks and complete publisher of part's content.headers()Returns HTTP part headers.booleanIndicate if the content of thisBodyPartinstance is buffered in memory.
-
Method Details
-
content
Description copied from interface:BodyPartGet the reactive representation of the part content.- Specified by:
contentin interfaceBodyPart- Returns:
MessageBodyContent, nevernull
-
drain
public void drain()Release all chunks and complete publisher of part's content. -
headers
Description copied from interface:BodyPartReturns HTTP part headers. -
isBuffered
public boolean isBuffered()Indicate if the content of thisBodyPartinstance is buffered in memory. When buffered,as(java.lang.Class)can be called to unmarshall the content synchronously. Otherwise, usecontent()andMessageBodyReadableContent.as(Class)to do it asynchronously with aSingle.- Returns:
trueif buffered,falseotherwise
-
as
Converts the part content into an instance of the requested type. This method can only be used if the part content is buffered!, seeisBuffered().- Type Parameters:
T- the requested type- Parameters:
clazz- the requested type class- Returns:
- T the converted content
- Throws:
IllegalStateException- if the part is not buffered or if an error occurs while converting the content
-
builder
Create a new builder instance.- Returns:
- Builder
-