Enum Class CompressedHttpServletResponse.Algorithm

java.lang.Object
java.lang.Enum<CompressedHttpServletResponse.Algorithm>
org.omnifaces.servlet.CompressedHttpServletResponse.Algorithm
All Implemented Interfaces:
Serializable, Comparable<CompressedHttpServletResponse.Algorithm>, Constable
Enclosing class:
CompressedHttpServletResponse

public static enum CompressedHttpServletResponse.Algorithm extends Enum<CompressedHttpServletResponse.Algorithm>
Available compression algorithms.
  • Enum Constant Details

  • Method Details

    • values

      public static CompressedHttpServletResponse.Algorithm[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static CompressedHttpServletResponse.Algorithm valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getEncodingDirective

      public String getEncodingDirective()
      Returns the encoding directive. This basically represents the unique identifier of the algorithm in the HTTP Accept-Encoding header as well as the HTTP Content-Encoding header.
      Returns:
      The directive.
    • getOutputStreamClass

      public Class<? extends OutputStream> getOutputStreamClass()
      Returns the output stream class being used.
      Returns:
      The output stream class being used.
    • isAvailable

      public boolean isAvailable()
      Returns true if this algorithm is available.
      Returns:
      true if this algorithm is available.
    • accepts

      public boolean accepts(HttpServletRequest request)
      Returns true if the given request accepts this algorithm.
      Parameters:
      request - The involved HTTP servlet request.
      Returns:
      true if the given request accepts this algorithm.
    • createOutputStream

      public OutputStream createOutputStream(HttpServletResponse response)
      Returns an output stream which is compressed using this algorithm for the given HTTP servlet response.
      Parameters:
      response - The HTTP servlet response to be compressed with this algorithm.
      Returns:
      An output stream which is compressed using this algorithm.
      Throws:
      UnsupportedOperationException - When the output stream cannot be constructed for some reason.
    • find

      Returns the best algorithm matching the given HTTP servlet request.
      Parameters:
      request - The HTTP servlet request to find the best algorithm for.
      Returns:
      The best algorithm matching the given HTTP servlet request.