java.lang.Object
io.helidon.media.multipart.MultiPartBodyWriter
- All Implemented Interfaces:
MessageBodyOperator<MessageBodyWriterContext>
,MessageBodyWriter<WriteableMultiPart>
public final class MultiPartBodyWriter
extends Object
implements MessageBodyWriter<WriteableMultiPart>
WriteableMultiPart
writer.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.helidon.media.common.MessageBodyOperator
MessageBodyOperator.PredicateResult
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The default boundary used for encoding multipart messages. -
Method Summary
Modifier and TypeMethodDescriptionaccept
(GenericType<?> type, MessageBodyWriterContext context) Test if the operator can convert the given type.static MultiPartBodyWriter
create()
Create a new writer instance that uses the default boundary delimiter.static MultiPartBodyWriter
Create a new instance ofMultiPartBodyWriter
with the specified boundary delimiter.write
(Single<? extends WriteableMultiPart> content, GenericType<? extends WriteableMultiPart> type, MessageBodyWriterContext context) Generate HTTP payload from the objects of the given type.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.MessageBodyWriter
marshall
-
Field Details
-
DEFAULT_BOUNDARY
The default boundary used for encoding multipart messages.- See Also:
-
-
Method Details
-
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(Single<? extends WriteableMultiPart> content, GenericType<? extends WriteableMultiPart> type, MessageBodyWriterContext context) Description copied from interface:MessageBodyWriter
Generate HTTP payload from the objects of the given type.- Specified by:
write
in interfaceMessageBodyWriter<WriteableMultiPart>
- Parameters:
content
- object single publisher to convert to payloadtype
- requested typecontext
- the context providing the headers abstraction- Returns:
- Publisher of objects
-
create
Create a new instance ofMultiPartBodyWriter
with the specified boundary delimiter.- Parameters:
boundary
- boundary string- Returns:
- MultiPartWriter
-
create
Create a new writer instance that uses the default boundary delimiter.- Returns:
- MultiPartWriter
- See Also:
-