- java.lang.Object
-
- io.helidon.media.multipart.BodyPartBodyStreamWriter
-
- All Implemented Interfaces:
MessageBodyOperator<MessageBodyWriterContext>
,MessageBodyStreamWriter<WriteableBodyPart>
public final class BodyPartBodyStreamWriter extends Object implements MessageBodyStreamWriter<WriteableBodyPart>
WriteableBodyPart
stream writer.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.helidon.media.common.MessageBodyOperator
MessageBodyOperator.PredicateResult
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MessageBodyOperator.PredicateResult
accept(GenericType<?> type, MessageBodyWriterContext context)
Test if the operator can convert the given type.static BodyPartBodyStreamWriter
create()
Create a new instance ofBodyPartBodyStreamWriter
with the default boundary delimiter.static BodyPartBodyStreamWriter
create(String boundary)
Create a new instance ofBodyPartBodyStreamWriter
with the specified boundary delimiter.Flow.Publisher<DataChunk>
write(Flow.Publisher<? extends WriteableBodyPart> content, GenericType<? extends WriteableBodyPart> type, MessageBodyWriterContext context)
Generate HTTP payload from the given stream of objects.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.helidon.media.common.MessageBodyStreamWriter
marshall
-
-
-
-
Method Detail
-
accept
public MessageBodyOperator.PredicateResult accept(GenericType<?> type, MessageBodyWriterContext context)
Description copied from interface:MessageBodyOperator
Test if the operator can convert the given type.- Specified by:
accept
in interfaceMessageBodyOperator<MessageBodyWriterContext>
- Parameters:
type
- the requested typecontext
- the context providing the headers abstraction- Returns:
MessageBodyOperator.PredicateResult
result
-
write
public Flow.Publisher<DataChunk> write(Flow.Publisher<? extends WriteableBodyPart> content, GenericType<? extends WriteableBodyPart> type, MessageBodyWriterContext context)
Description copied from interface:MessageBodyStreamWriter
Generate HTTP payload from the given stream of objects.- Specified by:
write
in interfaceMessageBodyStreamWriter<WriteableBodyPart>
- Parameters:
content
- objects to convert to payloadtype
- requested type representationcontext
- writer context- Returns:
- HTTP payload publisher
-
create
public static BodyPartBodyStreamWriter create()
Create a new instance ofBodyPartBodyStreamWriter
with the default boundary delimiter.- Returns:
- BodyPartStreamWriter
- See Also:
MultiPartBodyWriter.DEFAULT_BOUNDARY
-
create
public static BodyPartBodyStreamWriter create(String boundary)
Create a new instance ofBodyPartBodyStreamWriter
with the specified boundary delimiter.- Parameters:
boundary
- boundary string- Returns:
- BodyPartStreamWriter
-
-