Spring Integration

org.springframework.integration.http
Class MultipartAwareFormHttpMessageConverter

java.lang.Object
  extended by org.springframework.integration.http.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 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(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)
           
 
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(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 List<MediaType> getSupportedMediaTypes()
Specified by:
getSupportedMediaTypes in interface HttpMessageConverter<MultiValueMap<String,?>>

canRead

public boolean canRead(Class<?> clazz,
                       MediaType mediaType)
Specified by:
canRead in interface HttpMessageConverter<MultiValueMap<String,?>>

canWrite

public boolean canWrite(Class<?> clazz,
                        MediaType mediaType)
Specified by:
canWrite in interface HttpMessageConverter<MultiValueMap<String,?>>

read

public MultiValueMap<String,?> read(Class<? extends MultiValueMap<String,?>> clazz,
                                    HttpInputMessage inputMessage)
                             throws IOException,
                                    HttpMessageNotReadableException
Specified by:
read in interface HttpMessageConverter<MultiValueMap<String,?>>
Throws:
IOException
HttpMessageNotReadableException

write

public void write(MultiValueMap<String,?> map,
                  MediaType contentType,
                  HttpOutputMessage outputMessage)
           throws IOException,
                  HttpMessageNotWritableException
Specified by:
write in interface HttpMessageConverter<MultiValueMap<String,?>>
Throws:
IOException
HttpMessageNotWritableException

Spring Integration

Copyright © 2010. All Rights Reserved.