public class MultipartAwareFormHttpMessageConverter extends Object implements HttpMessageConverter<MultiValueMap<String,?>>
HttpMessageConverter
implementation that delegates to an instance of
AllEncompassingFormHttpMessageConverter
while adding the capability to read
multipart/form-data
content in an HTTP request.Constructor and Description |
---|
MultipartAwareFormHttpMessageConverter() |
Modifier and Type | Method and Description |
---|---|
boolean |
canRead(Class<?> clazz,
MediaType mediaType) |
boolean |
canWrite(Class<?> clazz,
MediaType mediaType) |
List<MediaType> |
getSupportedMediaTypes() |
MultiValueMap<String,?> |
read(Class<? extends MultiValueMap<String,?>> clazz,
HttpInputMessage inputMessage) |
void |
setCharset(Charset charset)
Sets the character set used for writing form data.
|
void |
setMultipartFileReader(MultipartFileReader<?> multipartFileReader)
Specify the
MultipartFileReader to use when reading MultipartFile content. |
void |
write(MultiValueMap<String,?> map,
MediaType contentType,
HttpOutputMessage outputMessage) |
public MultipartAwareFormHttpMessageConverter()
public void setCharset(Charset charset)
charset
- The charset.public void setMultipartFileReader(MultipartFileReader<?> multipartFileReader)
MultipartFileReader
to use when reading MultipartFile
content.multipartFileReader
- The multipart file reader.public List<MediaType> getSupportedMediaTypes()
getSupportedMediaTypes
in interface HttpMessageConverter<MultiValueMap<String,?>>
public boolean canRead(Class<?> clazz, MediaType mediaType)
canRead
in interface HttpMessageConverter<MultiValueMap<String,?>>
public boolean canWrite(Class<?> clazz, MediaType mediaType)
canWrite
in interface HttpMessageConverter<MultiValueMap<String,?>>
public MultiValueMap<String,?> read(Class<? extends MultiValueMap<String,?>> clazz, HttpInputMessage inputMessage) throws IOException, HttpMessageNotReadableException
read
in interface HttpMessageConverter<MultiValueMap<String,?>>
IOException
HttpMessageNotReadableException
public void write(MultiValueMap<String,?> map, MediaType contentType, HttpOutputMessage outputMessage) throws IOException, HttpMessageNotWritableException
write
in interface HttpMessageConverter<MultiValueMap<String,?>>
IOException
HttpMessageNotWritableException