类 ResourceDecoder
- java.lang.Object
- org.springframework.core.codec.AbstractDecoder<T>
- org.springframework.core.codec.AbstractDataBufferDecoder<Resource>
- org.springframework.core.codec.ResourceDecoder
public class ResourceDecoder extends AbstractDataBufferDecoder<Resource>
Decoder forResources.- 从以下版本开始:
- 5.0
- 作者:
- Arjen Poutsma, Rossen Stoyanchev
字段概要
字段 修饰符和类型 字段 说明 static StringFILENAME_HINTName of hint with a filename for the resource(e.g. from "Content-Disposition" HTTP header).从类继承的字段 org.springframework.core.codec.AbstractDecoder
logger
构造器概要
构造器 构造器 说明 ResourceDecoder()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 booleancanDecode(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(org.reactivestreams.Publisher<DataBuffer> inputStream, ResolvableType elementType, MimeType mimeType, Map<String,Object> hints)Decode aDataBufferinput stream into a Flux ofT.Resourcedecode(DataBuffer dataBuffer, ResolvableType elementType, MimeType mimeType, Map<String,Object> hints)Decode a data buffer to an Object of type T.从类继承的方法 org.springframework.core.codec.AbstractDataBufferDecoder
decodeDataBuffer, decodeToMono, getMaxInMemorySize, setMaxInMemorySize
从类继承的方法 org.springframework.core.codec.AbstractDecoder
getDecodableMimeTypes, getLogger, setLogger
字段详细资料
FILENAME_HINT
public static String FILENAME_HINT
Name of hint with a filename for the resource(e.g. from "Content-Disposition" HTTP header).
构造器详细资料
ResourceDecoder
public ResourceDecoder()
方法详细资料
canDecode
public boolean canDecode(ResolvableType elementType, @Nullable MimeType mimeType)
从接口复制的说明:DecoderWhether the decoder supports the given target element type and the MIME type of the source stream.
decode
public reactor.core.publisher.Flux<Resource> decode(org.reactivestreams.Publisher<DataBuffer> inputStream, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable Map<String,Object> hints)
从接口复制的说明:DecoderDecode aDataBufferinput stream into a Flux ofT.- 指定者:
decode在接口中Decoder<Resource>- 覆盖:
decode在类中AbstractDataBufferDecoder<Resource>- 参数:
inputStream- theDataBufferinput stream to decodeelementType- the expected type of elements in the output stream; this type must have been previously passed to theDecoder.canDecode(org.springframework.core.ResolvableType, org.springframework.util.MimeType)method and it must have returnedtrue.mimeType- the MIME type associated with the input stream (optional)hints- additional information about how to do encode- 返回:
- the output stream with decoded elements
decode
public Resource decode(DataBuffer dataBuffer, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable Map<String,Object> hints)
从接口复制的说明: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.- 参数:
dataBuffer- theDataBufferto decodeelementType- the expected output typemimeType- the MIME type associated with the datahints- additional information about how to do encode- 返回:
- the decoded value, possibly
null