Module org.omnifaces
Package org.omnifaces.servlet
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionIt will use one of the following Brotli compression output streams, whichever is available first:com.aayushatharva.brotli4j.encoder.BrotliOutputStreamcom.nixxcode.jvmbrotli.enc.BrotliOutputStreamIt will useDeflaterOutputStreamas compression output stream.It will useGZIPOutputStreamas compression output stream. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccepts(HttpServletRequest request) Returnstrueif the given request accepts this algorithm.createOutputStream(HttpServletResponse response) Returns an output stream which is compressed using this algorithm for the given HTTP servlet response.find(HttpServletRequest request) Returns the best algorithm matching the given HTTP servlet request.Returns the encoding directive.Class<? extends OutputStream>Returns the output stream class being used.booleanReturnstrueif this algorithm is available.Returns the enum constant of this class with the specified name.values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
BROTLI
It will use one of the following Brotli compression output streams, whichever is available first:com.aayushatharva.brotli4j.encoder.BrotliOutputStreamcom.nixxcode.jvmbrotli.enc.BrotliOutputStream
-
GZIP
It will useGZIPOutputStreamas compression output stream. -
DEFLATE
It will useDeflaterOutputStreamas compression output stream.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
getEncodingDirective
Returns the encoding directive. This basically represents the unique identifier of the algorithm in the HTTPAccept-Encodingheader as well as the HTTPContent-Encodingheader.- Returns:
- The directive.
-
getOutputStreamClass
Returns the output stream class being used.- Returns:
- The output stream class being used.
-
isAvailable
public boolean isAvailable()Returnstrueif this algorithm is available.- Returns:
trueif this algorithm is available.
-
accepts
Returnstrueif the given request accepts this algorithm.- Parameters:
request- The involved HTTP servlet request.- Returns:
trueif the given request accepts this algorithm.
-
createOutputStream
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.
-