Class PartEventHttpMessageReader
java.lang.Object
org.springframework.http.codec.LoggingCodecSupport
org.springframework.http.codec.multipart.PartEventHttpMessageReader
- All Implemented Interfaces:
- HttpMessageReader<PartEvent>
public class PartEventHttpMessageReader
extends LoggingCodecSupport
implements HttpMessageReader<PartEvent>
- Since:
- 6.0
- Author:
- Arjen Poutsma
- See Also:
- 
Field SummaryFields inherited from class org.springframework.http.codec.LoggingCodecSupportlogger
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleancanRead(ResolvableType elementType, MediaType mediaType) Whether the given object type is supported by this reader.intGet theconfiguredmaximum in-memory size.Return the list of media types supported by this reader.reactor.core.publisher.Flux<PartEvent>read(ResolvableType elementType, ReactiveHttpInputMessage message, Map<String, Object> hints) Read from the input message and decode to a stream of objects.reactor.core.publisher.Mono<PartEvent>readMono(ResolvableType elementType, ReactiveHttpInputMessage message, Map<String, Object> hints) Read from the input message and decode to a single object.voidsetHeadersCharset(Charset headersCharset) Set the character set used to decode headers.voidsetMaxHeadersSize(int byteCount) Configure the maximum amount of memory that is allowed per headers section of each part.voidsetMaxInMemorySize(int maxInMemorySize) Configure the maximum amount of memory allowed for form fields.Methods inherited from class org.springframework.http.codec.LoggingCodecSupportisEnableLoggingRequestDetails, setEnableLoggingRequestDetailsMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.http.codec.HttpMessageReadergetReadableMediaTypes, read, readMono
- 
Constructor Details- 
PartEventHttpMessageReaderpublic PartEventHttpMessageReader()
 
- 
- 
Method Details- 
getMaxInMemorySizepublic int getMaxInMemorySize()Get theconfiguredmaximum in-memory size.
- 
setMaxInMemorySizepublic void setMaxInMemorySize(int maxInMemorySize) Configure the maximum amount of memory allowed for form fields. When the limit is exceeded, form fields parts are rejected withDataBufferLimitException.By default this is set to 256K. - Parameters:
- maxInMemorySize- the in-memory limit in bytes; if set to -1 the entire contents will be stored in memory
 
- 
setMaxHeadersSizepublic void setMaxHeadersSize(int byteCount) Configure the maximum amount of memory that is allowed per headers section of each part. Defaults to 10K.- Parameters:
- byteCount- the maximum amount of memory for headers
 
- 
setHeadersCharsetSet the character set used to decode headers. Defaults to UTF-8 as per RFC 7578.- Parameters:
- headersCharset- the charset to use for decoding headers
- See Also:
 
- 
getReadableMediaTypesDescription copied from interface:HttpMessageReaderReturn the list of media types supported by this reader. The list may not apply to every possible target element type and calls to this method should typically be guarded viacanWrite(elementType, null). The list may also exclude media types supported only for a specific element type. Alternatively, useHttpMessageReader.getReadableMediaTypes(ResolvableType)for a more precise list.- Specified by:
- getReadableMediaTypesin interface- HttpMessageReader<PartEvent>
- Returns:
- the general list of supported media types
 
- 
canReadDescription copied from interface:HttpMessageReaderWhether the given object type is supported by this reader.- Specified by:
- canReadin interface- HttpMessageReader<PartEvent>
- Parameters:
- elementType- the type of object to check
- mediaType- the media type for the read (possibly- null)
- Returns:
- trueif readable,- falseotherwise
 
- 
readMonopublic reactor.core.publisher.Mono<PartEvent> readMono(ResolvableType elementType, ReactiveHttpInputMessage message, Map<String, Object> hints) Description copied from interface:HttpMessageReaderRead from the input message and decode to a single object.- Specified by:
- readMonoin interface- HttpMessageReader<PartEvent>
- Parameters:
- elementType- the type of objects in the stream which must have been previously checked via- HttpMessageReader.canRead(ResolvableType, MediaType)
- message- the message to read from
- hints- additional information about how to read and decode the input
- Returns:
- the decoded object
 
- 
readpublic reactor.core.publisher.Flux<PartEvent> read(ResolvableType elementType, ReactiveHttpInputMessage message, Map<String, Object> hints) Description copied from interface:HttpMessageReaderRead from the input message and decode to a stream of objects.- Specified by:
- readin interface- HttpMessageReader<PartEvent>
- Parameters:
- elementType- the type of objects in the stream which must have been previously checked via- HttpMessageReader.canRead(ResolvableType, MediaType)
- message- the message to read from
- hints- additional information about how to read and decode the input
- Returns:
- the decoded stream of elements
 
 
-