Spring Integration

org.springframework.integration.http.converter
Class MultipartAwareFormHttpMessageConverter

java.lang.Object
  extended by org.springframework.integration.http.converter.MultipartAwareFormHttpMessageConverter
All Implemented Interfaces:
org.springframework.http.converter.HttpMessageConverter<org.springframework.util.MultiValueMap<java.lang.String,?>>

public class MultipartAwareFormHttpMessageConverter
extends java.lang.Object
implements org.springframework.http.converter.HttpMessageConverter<org.springframework.util.MultiValueMap<java.lang.String,?>>

An HttpMessageConverter implementation that delegates to an instance of XmlAwareFormHttpMessageConverter while adding the capability to read multipart/form-data content in an HTTP request.

Since:
2.0
Author:
Mark Fisher

Constructor Summary
MultipartAwareFormHttpMessageConverter()
           
 
Method Summary
 boolean canRead(java.lang.Class<?> clazz, org.springframework.http.MediaType mediaType)
           
 boolean canWrite(java.lang.Class<?> clazz, org.springframework.http.MediaType mediaType)
           
 java.util.List<org.springframework.http.MediaType> getSupportedMediaTypes()
           
 org.springframework.util.MultiValueMap<java.lang.String,?> read(java.lang.Class<? extends org.springframework.util.MultiValueMap<java.lang.String,?>> clazz, org.springframework.http.HttpInputMessage inputMessage)
           
 void setCharset(java.nio.charset.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(org.springframework.util.MultiValueMap<java.lang.String,?> map, org.springframework.http.MediaType contentType, org.springframework.http.HttpOutputMessage outputMessage)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultipartAwareFormHttpMessageConverter

public MultipartAwareFormHttpMessageConverter()
Method Detail

setCharset

public void setCharset(java.nio.charset.Charset charset)
Sets the character set used for writing form data.


setMultipartFileReader

public void setMultipartFileReader(MultipartFileReader<?> multipartFileReader)
Specify the MultipartFileReader to use when reading MultipartFile content.


getSupportedMediaTypes

public java.util.List<org.springframework.http.MediaType> getSupportedMediaTypes()
Specified by:
getSupportedMediaTypes in interface org.springframework.http.converter.HttpMessageConverter<org.springframework.util.MultiValueMap<java.lang.String,?>>

canRead

public boolean canRead(java.lang.Class<?> clazz,
                       org.springframework.http.MediaType mediaType)
Specified by:
canRead in interface org.springframework.http.converter.HttpMessageConverter<org.springframework.util.MultiValueMap<java.lang.String,?>>

canWrite

public boolean canWrite(java.lang.Class<?> clazz,
                        org.springframework.http.MediaType mediaType)
Specified by:
canWrite in interface org.springframework.http.converter.HttpMessageConverter<org.springframework.util.MultiValueMap<java.lang.String,?>>

read

public org.springframework.util.MultiValueMap<java.lang.String,?> read(java.lang.Class<? extends org.springframework.util.MultiValueMap<java.lang.String,?>> clazz,
                                                                       org.springframework.http.HttpInputMessage inputMessage)
                                                                throws java.io.IOException,
                                                                       org.springframework.http.converter.HttpMessageNotReadableException
Specified by:
read in interface org.springframework.http.converter.HttpMessageConverter<org.springframework.util.MultiValueMap<java.lang.String,?>>
Throws:
java.io.IOException
org.springframework.http.converter.HttpMessageNotReadableException

write

public void write(org.springframework.util.MultiValueMap<java.lang.String,?> map,
                  org.springframework.http.MediaType contentType,
                  org.springframework.http.HttpOutputMessage outputMessage)
           throws java.io.IOException,
                  org.springframework.http.converter.HttpMessageNotWritableException
Specified by:
write in interface org.springframework.http.converter.HttpMessageConverter<org.springframework.util.MultiValueMap<java.lang.String,?>>
Throws:
java.io.IOException
org.springframework.http.converter.HttpMessageNotWritableException

Spring Integration