Class MultipartWriterSupport
java.lang.Object
org.springframework.http.codec.LoggingCodecSupport
org.springframework.http.codec.multipart.MultipartWriterSupport
- Direct Known Subclasses:
MultipartHttpMessageWriter
,PartHttpMessageWriter
Support class for multipart HTTP message writers.
- Since:
- 5.3
- Author:
- Rossen Stoyanchev
-
Field Summary
Fields inherited from class org.springframework.http.codec.LoggingCodecSupport
logger
-
Constructor Summary
ModifierConstructorDescriptionprotected
MultipartWriterSupport
(List<MediaType> supportedMediaTypes) Constructor with the list of supported media types. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canWrite
(ResolvableType elementType, MediaType mediaType) protected reactor.core.publisher.Mono<DataBuffer>
generateBoundaryLine
(byte[] boundary, DataBufferFactory bufferFactory) protected reactor.core.publisher.Mono<DataBuffer>
generateLastLine
(byte[] boundary, DataBufferFactory bufferFactory) protected byte[]
Generate a multipart boundary.protected reactor.core.publisher.Mono<DataBuffer>
generateNewLine
(DataBufferFactory bufferFactory) protected reactor.core.publisher.Mono<DataBuffer>
generatePartHeaders
(HttpHeaders headers, DataBufferFactory bufferFactory) Return the configured charset for part headers.protected MediaType
getMultipartMediaType
(MediaType mediaType, byte[] boundary) Prepare theMediaType
to use by adding "boundary" and "charset" parameters to the givenmediaType
or "mulitpart/form-data" otherwise by default.void
setCharset
(Charset charset) Set the character set to use for part headers such as "Content-Disposition" (and its filename parameter).Methods inherited from class org.springframework.http.codec.LoggingCodecSupport
isEnableLoggingRequestDetails, setEnableLoggingRequestDetails
-
Field Details
-
DEFAULT_CHARSET
THe default charset used by the writer.
-
-
Constructor Details
-
MultipartWriterSupport
Constructor with the list of supported media types.
-
-
Method Details
-
getCharset
Return the configured charset for part headers. -
setCharset
Set the character set to use for part headers such as "Content-Disposition" (and its filename parameter).By default this is set to "UTF-8". If changed from this default, the "Content-Type" header will have a "charset" parameter that specifies the character set used.
-
getWritableMediaTypes
-
canWrite
-
generateMultipartBoundary
protected byte[] generateMultipartBoundary()Generate a multipart boundary.By default delegates to
MimeTypeUtils.generateMultipartBoundary()
. -
getMultipartMediaType
Prepare theMediaType
to use by adding "boundary" and "charset" parameters to the givenmediaType
or "mulitpart/form-data" otherwise by default. -
generateBoundaryLine
protected reactor.core.publisher.Mono<DataBuffer> generateBoundaryLine(byte[] boundary, DataBufferFactory bufferFactory) -
generateNewLine
-
generateLastLine
protected reactor.core.publisher.Mono<DataBuffer> generateLastLine(byte[] boundary, DataBufferFactory bufferFactory) -
generatePartHeaders
protected reactor.core.publisher.Mono<DataBuffer> generatePartHeaders(HttpHeaders headers, DataBufferFactory bufferFactory)
-