Top Description Fields Constructors Methods
org.springframework.http.codec.multipart

public Class PartEventHttpMessageWriter

extends MultipartWriterSupport
implements HttpMessageWriter<PartEvent>
Class Inheritance
All Implemented Interfaces
org.springframework.http.codec.HttpMessageWriter
Imports
java.util.Collections, .Map, org.reactivestreams.Publisher, reactor.core.publisher.Flux, .Mono, org.springframework.core.ResolvableType, org.springframework.core.codec.Hints, org.springframework.core.io.buffer.DataBuffer, .DataBufferFactory, .DataBufferUtils, org.springframework.http.HttpHeaders, .MediaType, .ReactiveHttpOutputMessage, org.springframework.http.codec.HttpMessageWriter, org.springframework.lang.Nullable, org.springframework.util.Assert

HttpMessageWriter for writing PartEvent objects. Useful for server-side proxies, that relay multipart requests to others services.
Author
Arjen Poutsma
Since
6.0
See Also
PartEvent

Field Summary

Inherited from org.springframework.http.codec.multipart.MultipartWriterSupport:
DEFAULT_CHARSET

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
canWrite(ResolvableType
the type of object to check
elementType
,
MediaType
the media type for the write (possibly null)
mediaType
)

Implements org.springframework.http.codec.HttpMessageWriter.canWrite.

Whether the given object type is supported by this writer.

private Flux<DataBuffer>
encodePartData(byte[] boundary, DataBufferFactory bufferFactory, HttpHeaders headers, Flux<DataBuffer> body)

public Mono<Void>
write(Publisher<? extends PartEvent>
the objects to write
partDataStream
,
ResolvableType
the type of objects in the stream which must have been previously checked via canWrite(ResolvableType, MediaType)
elementType
,
MediaType
the content type for the write (possibly null to indicate that the default content type of the writer must be used)
mediaType
,
ReactiveHttpOutputMessage
the message to write to
outputMessage
,
Map<String, Object>
additional information about how to encode and write
hints
)

Implements org.springframework.http.codec.HttpMessageWriter.write.

Write a given stream of object to the output message.

Inherited from org.springframework.http.codec.multipart.MultipartWriterSupport:
generateBoundaryLinegenerateLastLinegenerateMultipartBoundarygenerateNewLinegeneratePartHeadersgetCharsetgetMultipartMediaTypegetWritableMediaTypessetCharset

Constructor Detail

PartEventHttpMessageWriterback to summary
public PartEventHttpMessageWriter()

Method Detail

canWriteback to summary
public boolean canWrite(ResolvableType elementType, MediaType mediaType)

Implements org.springframework.http.codec.HttpMessageWriter.canWrite.

Doc from org.springframework.http.codec.HttpMessageWriter.canWrite.

Whether the given object type is supported by this writer.

Parameters
elementType:ResolvableType

the type of object to check

mediaType:MediaType

the media type for the write (possibly null)

Returns:boolean

true if writable, false otherwise

Annotations
@Override
encodePartDataback to summary
private Flux<DataBuffer> encodePartData(byte[] boundary, DataBufferFactory bufferFactory, HttpHeaders headers, Flux<DataBuffer> body)
writeback to summary
public Mono<Void> write(Publisher<? extends PartEvent> partDataStream, ResolvableType elementType, MediaType mediaType, ReactiveHttpOutputMessage outputMessage, Map<String, Object> hints)

Implements org.springframework.http.codec.HttpMessageWriter.write.

Doc from org.springframework.http.codec.HttpMessageWriter.write.

Write a given stream of object to the output message.

Parameters
partDataStream:Publisher<? extends PartEvent>

the objects to write

elementType:ResolvableType

the type of objects in the stream which must have been previously checked via canWrite(ResolvableType, MediaType)

mediaType:MediaType

the content type for the write (possibly null to indicate that the default content type of the writer must be used)

outputMessage:ReactiveHttpOutputMessage

the message to write to

hints:Map<String, Object>

additional information about how to encode and write

Returns:Mono<Void>

indicates completion or error

Annotations
@Override