Package org.springframework.core.codec
Class ResourceDecoder
java.lang.Object
org.springframework.core.codec.AbstractDecoder<T>
org.springframework.core.codec.AbstractDataBufferDecoder<Resource>
org.springframework.core.codec.ResourceDecoder
Decoder for 
Resources.- Since:
- 5.0
- Author:
- Arjen Poutsma, Rossen Stoyanchev
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringName of hint with a filename for the resource(for example, from "Content-Disposition" HTTP header).Fields inherited from class org.springframework.core.codec.AbstractDecoderlogger
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleancanDecode(ResolvableType elementType, MimeType mimeType) Whether the decoder supports the given target element type and the MIME type of the source stream.reactor.core.publisher.Flux<Resource>decode(Publisher<DataBuffer> inputStream, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) Decode aDataBufferinput stream into a Flux ofT.decode(DataBuffer dataBuffer, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) Decode a data buffer to an Object of type T.Methods inherited from class org.springframework.core.codec.AbstractDataBufferDecoderdecodeDataBuffer, decodeToMono, getMaxInMemorySize, setMaxInMemorySizeMethods inherited from class org.springframework.core.codec.AbstractDecodergetDecodableMimeTypes, getLogger, setLoggerMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.core.codec.DecodergetDecodableMimeTypes
- 
Field Details- 
FILENAME_HINTName of hint with a filename for the resource(for example, from "Content-Disposition" HTTP header).
 
- 
- 
Constructor Details- 
ResourceDecoderpublic ResourceDecoder()
 
- 
- 
Method Details- 
canDecodeDescription copied from interface:DecoderWhether the decoder supports the given target element type and the MIME type of the source stream.- Specified by:
- canDecodein interface- Decoder<Resource>
- Overrides:
- canDecodein class- AbstractDecoder<Resource>
- Parameters:
- elementType- the target element type for the output stream
- mimeType- the mime type associated with the stream to decode (can be- nullif not specified)
- Returns:
- trueif supported,- falseotherwise
 
- 
decodepublic reactor.core.publisher.Flux<Resource> decode(Publisher<DataBuffer> inputStream, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable Map<String, Object> hints) Description copied from interface:DecoderDecode aDataBufferinput stream into a Flux ofT.- Specified by:
- decodein interface- Decoder<Resource>
- Overrides:
- decodein class- AbstractDataBufferDecoder<Resource>
- Parameters:
- inputStream- the- DataBufferinput stream to decode
- elementType- the expected type of elements in the output stream; this type must have been previously passed to the- Decoder.canDecode(org.springframework.core.ResolvableType, org.springframework.util.MimeType)method and it must have returned- true.
- mimeType- the MIME type associated with the input stream (optional)
- hints- additional information about how to do decode
- Returns:
- the output stream with decoded elements
 
- 
decodepublic Resource decode(DataBuffer dataBuffer, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable Map<String, Object> hints) Description copied from interface:DecoderDecode a data buffer to an Object of type T. This is useful for scenarios, that distinct messages (or events) are decoded and handled individually, in fully aggregated form.- Parameters:
- dataBuffer- the- DataBufferto decode
- elementType- the expected output type
- mimeType- the MIME type associated with the data
- hints- additional information about how to do decode
- Returns:
- the decoded value, possibly null
 
 
-