java.lang.Object
io.helidon.media.multipart.ReadableBodyPart
- All Implemented Interfaces:
BodyPart
Readable body part entity.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Builder class for creatingBodyPart
instances. -
Method Summary
Modifier and TypeMethodDescription<T> T
Converts the part content into an instance of the requested type.static ReadableBodyPart.Builder
builder()
Create a new builder instance.content()
Get the reactive representation of the part content.void
drain()
Release all chunks and complete publisher of part's content.headers()
Returns HTTP part headers.boolean
Indicate if the content of thisBodyPart
instance is buffered in memory.
-
Method Details
-
content
Description copied from interface:BodyPart
Get the reactive representation of the part content.- Specified by:
content
in interfaceBodyPart
- Returns:
MessageBodyContent
, nevernull
-
drain
public void drain()Release all chunks and complete publisher of part's content. -
headers
Description copied from interface:BodyPart
Returns HTTP part headers. -
isBuffered
public boolean isBuffered()Indicate if the content of thisBodyPart
instance 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:
true
if buffered,false
otherwise
-
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
-