Package feign.form.spring.converter
Class SpringManyMultipartFilesReader
java.lang.Object
org.springframework.http.converter.AbstractHttpMessageConverter<org.springframework.web.multipart.MultipartFile[]>
feign.form.spring.converter.SpringManyMultipartFilesReader
- All Implemented Interfaces:
org.springframework.http.converter.HttpMessageConverter<org.springframework.web.multipart.MultipartFile[]>
public class SpringManyMultipartFilesReader
extends org.springframework.http.converter.AbstractHttpMessageConverter<org.springframework.web.multipart.MultipartFile[]>
Implementation of
HttpMessageConverter that can read multipart/form-data HTTP bodies
(writing is not handled because that is already supported by FormHttpMessageConverter).
This reader supports an array of MultipartFile as the mapping return class type - each
multipart body is read into an underlying byte array (in memory) implemented via ByteArrayMultipartFile.
-
Field Summary
Fields inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
logger -
Constructor Summary
ConstructorsConstructorDescriptionSpringManyMultipartFilesReader(int bufSize) Construct anAbstractHttpMessageConverterthat can read mulitpart/form-data. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancanWrite(org.springframework.http.MediaType mediaType) protected org.springframework.web.multipart.MultipartFile[]readInternal(Class<? extends org.springframework.web.multipart.MultipartFile[]> clazz, org.springframework.http.HttpInputMessage inputMessage) protected booleanprotected voidwriteInternal(org.springframework.web.multipart.MultipartFile[] byteArrayMultipartFiles, org.springframework.http.HttpOutputMessage outputMessage) Methods inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
addDefaultHeaders, canRead, canRead, canWrite, getContentLength, getDefaultCharset, getDefaultContentType, getSupportedMediaTypes, read, setDefaultCharset, setSupportedMediaTypes, supportsRepeatableWrites, writeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.http.converter.HttpMessageConverter
getSupportedMediaTypes
-
Constructor Details
-
SpringManyMultipartFilesReader
public SpringManyMultipartFilesReader(int bufSize) Construct anAbstractHttpMessageConverterthat can read mulitpart/form-data.- Parameters:
bufSize- The size of the buffer (in bytes) to read the HTTP multipart body.
-
-
Method Details
-
canWrite
protected boolean canWrite(org.springframework.http.MediaType mediaType) - Overrides:
canWritein classorg.springframework.http.converter.AbstractHttpMessageConverter<org.springframework.web.multipart.MultipartFile[]>
-
supports
- Specified by:
supportsin classorg.springframework.http.converter.AbstractHttpMessageConverter<org.springframework.web.multipart.MultipartFile[]>
-
readInternal
protected org.springframework.web.multipart.MultipartFile[] readInternal(Class<? extends org.springframework.web.multipart.MultipartFile[]> clazz, org.springframework.http.HttpInputMessage inputMessage) throws IOException - Specified by:
readInternalin classorg.springframework.http.converter.AbstractHttpMessageConverter<org.springframework.web.multipart.MultipartFile[]>- Throws:
IOException
-
writeInternal
protected void writeInternal(org.springframework.web.multipart.MultipartFile[] byteArrayMultipartFiles, org.springframework.http.HttpOutputMessage outputMessage) - Specified by:
writeInternalin classorg.springframework.http.converter.AbstractHttpMessageConverter<org.springframework.web.multipart.MultipartFile[]>
-