- java.lang.Object
-
- io.helidon.media.multipart.ReadableBodyPart
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classReadableBodyPart.BuilderBuilder class for creatingBodyPartinstances.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Tas(Class<T> clazz)Converts the part content into an instance of the requested type.static ReadableBodyPart.Builderbuilder()Create a new builder instance.MessageBodyReadableContentcontent()Get the reactive representation of the part content.voiddrain()Release all chunks and complete publisher of part's content.ReadableBodyPartHeadersheaders()Returns HTTP part headers.booleanisBuffered()Indicate if the content of thisBodyPartinstance is buffered in memory.
-
-
-
Method Detail
-
content
public MessageBodyReadableContent 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
public ReadableBodyPartHeaders 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
public <T> T as(Class<T> clazz)
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
public static ReadableBodyPart.Builder builder()
Create a new builder instance.- Returns:
- Builder
-
-