Class MultipartAwareFormHttpMessageConverter
java.lang.Object
org.springframework.integration.http.converter.MultipartAwareFormHttpMessageConverter
- All Implemented Interfaces:
HttpMessageConverter<MultiValueMap<String,
?>>
public class MultipartAwareFormHttpMessageConverter
extends Object
implements HttpMessageConverter<MultiValueMap<String,?>>
An
HttpMessageConverter
implementation that delegates to an instance of
AllEncompassingFormHttpMessageConverter
while adding the capability to read
multipart/form-data
content in an HTTP request.- Since:
- 2.0
- Author:
- Mark Fisher, Gary Russell, Artem Bilan
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
read
(Class<? extends MultiValueMap<String, ?>> clazz, HttpInputMessage inputMessage) void
setCharset
(Charset charset) Set the character set used for writing form data.void
setMultipartFileReader
(MultipartFileReader<?> multipartFileReader) Specify theMultipartFileReader
to use when readingMultipartFile
content.void
write
(MultiValueMap<String, ?> map, MediaType contentType, HttpOutputMessage outputMessage) 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.converter.HttpMessageConverter
getSupportedMediaTypes
-
Constructor Details
-
MultipartAwareFormHttpMessageConverter
public MultipartAwareFormHttpMessageConverter()
-
-
Method Details
-
setCharset
Set the character set used for writing form data.- Parameters:
charset
- The charset.
-
setMultipartFileReader
Specify theMultipartFileReader
to use when readingMultipartFile
content.- Parameters:
multipartFileReader
- The multipart file reader.
-
getSupportedMediaTypes
- Specified by:
getSupportedMediaTypes
in interfaceHttpMessageConverter<MultiValueMap<String,
?>>
-
canRead
- Specified by:
canRead
in interfaceHttpMessageConverter<MultiValueMap<String,
?>>
-
canWrite
- Specified by:
canWrite
in interfaceHttpMessageConverter<MultiValueMap<String,
?>>
-
read
public MultiValueMap<String,?> read(Class<? extends MultiValueMap<String, ?>> clazz, HttpInputMessage inputMessage) throws IOException, HttpMessageNotReadableException- Specified by:
read
in interfaceHttpMessageConverter<MultiValueMap<String,
?>> - Throws:
IOException
HttpMessageNotReadableException
-
write
public void write(MultiValueMap<String, ?> map, MediaType contentType, HttpOutputMessage outputMessage) throws IOException, HttpMessageNotWritableException- Specified by:
write
in interfaceHttpMessageConverter<MultiValueMap<String,
?>> - Throws:
IOException
HttpMessageNotWritableException
-