- java.lang.Object
-
- io.helidon.media.multipart.MultiPartBodyWriter
-
- All Implemented Interfaces:
MessageBodyOperator<MessageBodyWriterContext>,MessageBodyWriter<WriteableMultiPart>
public final class MultiPartBodyWriter extends Object implements MessageBodyWriter<WriteableMultiPart>
WriteableMultiPartwriter.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.helidon.media.common.MessageBodyOperator
MessageBodyOperator.PredicateResult
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_BOUNDARYThe default boundary used for encoding multipart messages.
-
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 MultiPartBodyWritercreate()Create a new writer instance that uses the default boundary delimiter.static MultiPartBodyWritercreate(String boundary)Create a new instance ofMultiPartBodyWriterwith the specified boundary delimiter.Flow.Publisher<DataChunk>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 Detail
-
DEFAULT_BOUNDARY
public static final String DEFAULT_BOUNDARY
The default boundary used for encoding multipart messages.- See Also:
- Constant Field Values
-
-
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(Single<? extends WriteableMultiPart> content, GenericType<? extends WriteableMultiPart> type, MessageBodyWriterContext context)
Description copied from interface:MessageBodyWriterGenerate HTTP payload from the objects of the given type.- Specified by:
writein interfaceMessageBodyWriter<WriteableMultiPart>- Parameters:
content- object single publisher to convert to payloadtype- requested typecontext- the context providing the headers abstraction- Returns:
- Publisher of objects
-
create
public static MultiPartBodyWriter create(String boundary)
Create a new instance ofMultiPartBodyWriterwith the specified boundary delimiter.- Parameters:
boundary- boundary string- Returns:
- MultiPartWriter
-
create
public static MultiPartBodyWriter create()
Create a new writer instance that uses the default boundary delimiter.- Returns:
- MultiPartWriter
- See Also:
DEFAULT_BOUNDARY
-
-