- java.lang.Object
-
- io.helidon.media.multipart.BodyPartBodyStreamWriter
-
- All Implemented Interfaces:
MessageBodyOperator<MessageBodyWriterContext>,MessageBodyStreamWriter<WriteableBodyPart>
public final class BodyPartBodyStreamWriter extends Object implements MessageBodyStreamWriter<WriteableBodyPart>
WriteableBodyPartstream 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.PredicateResultaccept(GenericType<?> type, MessageBodyWriterContext context)Test if the operator can convert the given type.static BodyPartBodyStreamWritercreate()Create a new instance ofBodyPartBodyStreamWriterwith the default boundary delimiter.static BodyPartBodyStreamWritercreate(String boundary)Create a new instance ofBodyPartBodyStreamWriterwith 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:MessageBodyOperatorTest if the operator can convert the given type.- Specified by:
acceptin interfaceMessageBodyOperator<MessageBodyWriterContext>- Parameters:
type- the requested typecontext- the context providing the headers abstraction- Returns:
MessageBodyOperator.PredicateResultresult
-
write
public Flow.Publisher<DataChunk> write(Flow.Publisher<? extends WriteableBodyPart> content, GenericType<? extends WriteableBodyPart> type, MessageBodyWriterContext context)
Description copied from interface:MessageBodyStreamWriterGenerate HTTP payload from the given stream of objects.- Specified by:
writein 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 ofBodyPartBodyStreamWriterwith the default boundary delimiter.- Returns:
- BodyPartStreamWriter
- See Also:
MultiPartBodyWriter.DEFAULT_BOUNDARY
-
create
public static BodyPartBodyStreamWriter create(String boundary)
Create a new instance ofBodyPartBodyStreamWriterwith the specified boundary delimiter.- Parameters:
boundary- boundary string- Returns:
- BodyPartStreamWriter
-
-