- 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
Fields Modifier and Type Field Description static String
DEFAULT_BOUNDARY
The default boundary used for encoding multipart messages.
-
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 MultiPartBodyWriter
create()
Create a new writer instance that uses the default boundary delimiter.static MultiPartBodyWriter
create(String boundary)
Create a new instance ofMultiPartBodyWriter
with 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: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
public static MultiPartBodyWriter create(String boundary)
Create a new instance ofMultiPartBodyWriter
with 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
-
-