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 org.springframework.http.codec.multipart.MultipartWriterSupport
DEFAULT_CHARSET
Fields inherited from class org.springframework.http.codec.LoggingCodecSupport
logger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Whether the given object type is supported by this writer.reactor.core.publisher.Mono<Void>
write
(Publisher<? extends PartEvent> partDataStream, org.springframework.core.ResolvableType elementType, MediaType mediaType, ReactiveHttpOutputMessage outputMessage, Map<String, Object> hints) Write a given stream of object to the output message.Methods inherited from class org.springframework.http.codec.multipart.MultipartWriterSupport
generateBoundaryLine, generateLastLine, generateMultipartBoundary, generateNewLine, generatePartHeaders, getCharset, getMultipartMediaType, getWritableMediaTypes, setCharset
Methods inherited from class org.springframework.http.codec.LoggingCodecSupport
isEnableLoggingRequestDetails, setEnableLoggingRequestDetails
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.http.codec.HttpMessageWriter
getWritableMediaTypes, getWritableMediaTypes, write
-
Constructor Details
-
PartEventHttpMessageWriter
public PartEventHttpMessageWriter()
-
-
Method Details
-
canWrite
public boolean canWrite(org.springframework.core.ResolvableType elementType, @Nullable MediaType mediaType) Description copied from interface:HttpMessageWriter
Whether the given object type is supported by this writer.- Specified by:
canWrite
in interfaceHttpMessageWriter<PartEvent>
- Parameters:
elementType
- the type of object to checkmediaType
- the media type for the write (possiblynull
)- Returns:
true
if writable,false
otherwise
-
write
public reactor.core.publisher.Mono<Void> write(Publisher<? extends PartEvent> partDataStream, org.springframework.core.ResolvableType elementType, @Nullable MediaType mediaType, ReactiveHttpOutputMessage outputMessage, Map<String, Object> hints) Description copied from interface:HttpMessageWriter
Write a given stream of object to the output message.- Specified by:
write
in 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 (possiblynull
to 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
-