Class EncodingRegistry


  • public class EncodingRegistry
    extends java.lang.Object
    Class that stores a register of available encoding and transfer coding handlers.
    • Method Detail

      • getIdentityTransferCodingHandler

        public TransferEncoding getIdentityTransferCodingHandler()
        Return the ContentEncoding corresponding to identity transfer coding (i.e. no transfer coding).
        Returns:
        Return the ContentEncoding corresponding to identity transfer coding (i.e. no transfer coding)
      • getChunkedTransferEncoding

        public TransferEncoding getChunkedTransferEncoding()
        Return the ContentEncoding corresponding to chunked transfer coding.
        Returns:
        Return the ContentEncoding corresponding to chunked transfer coding.
      • getContentEncoding

        @Nullable
        public ContentEncoding getContentEncoding​(@Nullable
                                                  java.lang.String encoding)
        Return the ContentEncoding corresponding to the given encoding.
        Parameters:
        encoding - case insensitive (See RFC2616, 3.5).
        Returns:
        null if no handler has been registered to match this encoding.
      • getTransferEncoding

        @Nullable
        public TransferEncoding getTransferEncoding​(@Nullable
                                                    java.lang.String encoding)
        Return the TransferEncoding corresponding to the given encoding.
        Parameters:
        encoding - case insensitive (See RFC2616, 3.5).
        Returns:
        null if no handler has been registered to match this encoding.
      • registerContentEncoding

        public void registerContentEncoding​(ContentEncoding handler)
        Registers a new HTTP content encoding handler.
        Parameters:
        handler - the ContentEncoding to register.
      • registerTransferEncoding

        public void registerTransferEncoding​(TransferEncoding handler)
        Registers a new HTTP transfer coding handler.
        Parameters:
        handler - the TransferEncoding to register.
      • getAcceptEncodingHandler

        @Nullable
        public ContentEncoding getAcceptEncodingHandler​(@Nullable
                                                        java.lang.String encoding)
        Returns the most suitable ContentEncoding to match the encodings described in Accept-Encoding header.
        Parameters:
        encoding - is on the form gzip, identity or gzip; q=0.8, identity; q=0.2.
        Returns:
        the ContentEncoding, or null if no suitable handler can be found.