Class PartEventHttpMessageWriter
java.lang.Object
org.springframework.http.codec.LoggingCodecSupport
org.springframework.http.codec.multipart.MultipartWriterSupport
org.springframework.http.codec.multipart.PartEventHttpMessageWriter
- All Implemented Interfaces:
HttpMessageWriter<PartEvent>
public class PartEventHttpMessageWriter
extends MultipartWriterSupport
implements HttpMessageWriter<PartEvent>
HttpMessageWriter for writing PartEvent objects. Useful for
server-side proxies, that relay multipart requests to others services.- Since:
- 6.0
- Author:
- Arjen Poutsma
- See Also:
-
Field Summary
Fields inherited from class MultipartWriterSupport
DEFAULT_CHARSETFields inherited from class LoggingCodecSupport
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanWrite(ResolvableType elementType, @Nullable MediaType mediaType) Whether the given object type is supported by this writer.reactor.core.publisher.Mono<Void> write(Publisher<? extends PartEvent> partDataStream, ResolvableType elementType, @Nullable MediaType mediaType, ReactiveHttpOutputMessage outputMessage, Map<String, Object> hints) Write a given stream of object to the output message.Methods inherited from class MultipartWriterSupport
generateBoundaryLine, generateLastLine, generateMultipartBoundary, generateNewLine, generatePartHeaders, getCharset, getMultipartMediaType, getWritableMediaTypes, setCharsetMethods inherited from class LoggingCodecSupport
isEnableLoggingRequestDetails, setEnableLoggingRequestDetailsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface HttpMessageWriter
getWritableMediaTypes, getWritableMediaTypes, write
-
Constructor Details
-
PartEventHttpMessageWriter
public PartEventHttpMessageWriter()
-
-
Method Details
-
canWrite
Description copied from interface:HttpMessageWriterWhether the given object type is supported by this writer.- Specified by:
canWritein interfaceHttpMessageWriter<PartEvent>- Parameters:
elementType- the type of object to checkmediaType- the media type for the write (possiblynull)- Returns:
trueif writable,falseotherwise
-
write
public reactor.core.publisher.Mono<Void> write(Publisher<? extends PartEvent> partDataStream, ResolvableType elementType, @Nullable MediaType mediaType, ReactiveHttpOutputMessage outputMessage, Map<String, Object> hints) Description copied from interface:HttpMessageWriterWrite a given stream of object to the output message.- Specified by:
writein interfaceHttpMessageWriter<PartEvent>- Parameters:
partDataStream- the objects to writeelementType- the type of objects in the stream which must have been previously checked viaHttpMessageWriter.canWrite(ResolvableType, MediaType)mediaType- the content type for the write (possiblynullto indicate that the default content type of the writer must be used)outputMessage- the message to write tohints- additional information about how to encode and write- Returns:
- indicates completion or error
-