Class BodyHandlers.DecompressingBodyHandlerBuilder

  • Enclosing class:
    BodyHandlers

    public static final class BodyHandlers.DecompressingBodyHandlerBuilder
    extends java.lang.Object
    The builder for decompressing body handler.
    • Constructor Detail

      • DecompressingBodyHandlerBuilder

        public DecompressingBodyHandlerBuilder()
    • Method Detail

      • failOnUnsupportedDirectives

        public BodyHandlers.DecompressingBodyHandlerBuilder failOnUnsupportedDirectives​(boolean failOnUnsupportedDirectives)
        Sets whether throw exception when compression directive not supported or not.
        Parameters:
        failOnUnsupportedDirectives - Whether throw exception when compression directive not supported or not
        Returns:
        this for fluent chaining.
      • failOnUnknownDirectives

        public BodyHandlers.DecompressingBodyHandlerBuilder failOnUnknownDirectives​(boolean failOnUnknownDirectives)
        Sets whether throw exception when unknown compression directive encountered or not.
        Parameters:
        failOnUnknownDirectives - Whether throw exception when unknown compression directive encountered or not
        Returns:
        this for fluent chaining.
      • build

        public java.net.http.HttpResponse.BodyHandler<java.io.InputStream> build()
        Creates the new decompressing body handler.
        Returns:
        The builder for decompressing body handler.
      • build

        public <T> java.net.http.HttpResponse.BodyHandler<T> build​(java.net.http.HttpResponse.BodyHandler<T> downstream)
        Creates the new decompressing body handler.

        Please use build() if downstream is HttpResponse.BodyHandlers.ofInputStream().

        Returns:
        The builder for decompressing body handler.