public class MultipartWriterSupport extends LoggingCodecSupport
Modifier and Type | Field and Description |
---|---|
static Charset |
DEFAULT_CHARSET
THe default charset used by the writer.
|
logger
Modifier | Constructor and Description |
---|---|
protected |
MultipartWriterSupport(List<MediaType> supportedMediaTypes)
Constructor with the list of supported media types.
|
Modifier and Type | Method and Description |
---|---|
boolean |
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[] |
generateMultipartBoundary()
Generate a multipart boundary.
|
protected reactor.core.publisher.Mono<DataBuffer> |
generateNewLine(DataBufferFactory bufferFactory) |
protected reactor.core.publisher.Mono<DataBuffer> |
generatePartHeaders(HttpHeaders headers,
DataBufferFactory bufferFactory) |
Charset |
getCharset()
Return the configured charset for part headers.
|
protected MediaType |
getMultipartMediaType(MediaType mediaType,
byte[] boundary)
Prepare the
MediaType to use by adding "boundary" and "charset"
parameters to the given mediaType or "multipart/form-data"
otherwise by default. |
List<MediaType> |
getWritableMediaTypes() |
void |
setCharset(Charset charset)
Set the character set to use for part headers such as
"Content-Disposition" (and its filename parameter).
|
isEnableLoggingRequestDetails, setEnableLoggingRequestDetails
public static final Charset DEFAULT_CHARSET
public Charset getCharset()
public void setCharset(Charset charset)
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.
public boolean canWrite(ResolvableType elementType, @Nullable MediaType mediaType)
protected byte[] generateMultipartBoundary()
By default delegates to MimeTypeUtils.generateMultipartBoundary()
.
protected MediaType getMultipartMediaType(@Nullable MediaType mediaType, byte[] boundary)
MediaType
to use by adding "boundary" and "charset"
parameters to the given mediaType
or "multipart/form-data"
otherwise by default.protected reactor.core.publisher.Mono<DataBuffer> generateBoundaryLine(byte[] boundary, DataBufferFactory bufferFactory)
protected reactor.core.publisher.Mono<DataBuffer> generateNewLine(DataBufferFactory bufferFactory)
protected reactor.core.publisher.Mono<DataBuffer> generateLastLine(byte[] boundary, DataBufferFactory bufferFactory)
protected reactor.core.publisher.Mono<DataBuffer> generatePartHeaders(HttpHeaders headers, DataBufferFactory bufferFactory)