Search in sources :

Example 1 with ResourceHttpMessageReader

use of org.springframework.http.codec.ResourceHttpMessageReader in project spring-framework by spring-projects.

the class BaseDefaultCodecs method initTypedReaders.

/**
 * Reset and initialize typed readers.
 * @since 5.3.3
 */
protected void initTypedReaders() {
    this.typedReaders.clear();
    if (!this.registerDefaults) {
        return;
    }
    addCodec(this.typedReaders, new DecoderHttpMessageReader<>(new ByteArrayDecoder()));
    addCodec(this.typedReaders, new DecoderHttpMessageReader<>(new ByteBufferDecoder()));
    addCodec(this.typedReaders, new DecoderHttpMessageReader<>(new DataBufferDecoder()));
    if (nettyByteBufPresent) {
        addCodec(this.typedReaders, new DecoderHttpMessageReader<>(new NettyByteBufDecoder()));
    }
    addCodec(this.typedReaders, new ResourceHttpMessageReader(new ResourceDecoder()));
    addCodec(this.typedReaders, new DecoderHttpMessageReader<>(StringDecoder.textPlainOnly()));
    if (protobufPresent) {
        addCodec(this.typedReaders, new DecoderHttpMessageReader<>(this.protobufDecoder != null ? (ProtobufDecoder) this.protobufDecoder : new ProtobufDecoder()));
    }
    addCodec(this.typedReaders, new FormHttpMessageReader());
    // client vs server..
    extendTypedReaders(this.typedReaders);
}
Also used : FormHttpMessageReader(org.springframework.http.codec.FormHttpMessageReader) NettyByteBufDecoder(org.springframework.core.codec.NettyByteBufDecoder) DataBufferDecoder(org.springframework.core.codec.DataBufferDecoder) AbstractDataBufferDecoder(org.springframework.core.codec.AbstractDataBufferDecoder) ProtobufDecoder(org.springframework.http.codec.protobuf.ProtobufDecoder) ResourceHttpMessageReader(org.springframework.http.codec.ResourceHttpMessageReader) ResourceDecoder(org.springframework.core.codec.ResourceDecoder) ByteBufferDecoder(org.springframework.core.codec.ByteBufferDecoder) ByteArrayDecoder(org.springframework.core.codec.ByteArrayDecoder)

Aggregations

AbstractDataBufferDecoder (org.springframework.core.codec.AbstractDataBufferDecoder)1 ByteArrayDecoder (org.springframework.core.codec.ByteArrayDecoder)1 ByteBufferDecoder (org.springframework.core.codec.ByteBufferDecoder)1 DataBufferDecoder (org.springframework.core.codec.DataBufferDecoder)1 NettyByteBufDecoder (org.springframework.core.codec.NettyByteBufDecoder)1 ResourceDecoder (org.springframework.core.codec.ResourceDecoder)1 FormHttpMessageReader (org.springframework.http.codec.FormHttpMessageReader)1 ResourceHttpMessageReader (org.springframework.http.codec.ResourceHttpMessageReader)1 ProtobufDecoder (org.springframework.http.codec.protobuf.ProtobufDecoder)1