Class CompressionConfig.Builder
- Enclosing class:
CompressionConfig
The builder of CompressionConfig
immutable instances.
Notes about PathSpec strings
There are 2 syntaxes supported, Servlet url-pattern
based,
and regex based.
- If the spec starts with
'^'
the spec is assumed to be a regex based path spec and will match with normal Java regex rules. - If the spec starts with
'/'
then spec is assumed to be a Servlet url-pattern rules path spec for either an exact match or prefix based match. - If the spec starts with
'*.'
then spec is assumed to be a Servlet url-pattern rules path spec for a suffix based match. - All other syntaxes are unsupported
For all properties, exclusion takes precedence over inclusion,
as defined by IncludeExcludeSet
.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
compressExcludeEncoding
(String encoding) compressExcludeMethod
(String method) compressExcludeMimeType
(String mimetype) compressExcludePath
(String pathSpecString) A path spec to exclude for response compression.compressIncludeEncoding
(String encoding) compressIncludeMethod
(String method) compressIncludeMimeType
(String mimetype) compressIncludePath
(String pathSpecString) A path spec to include for response compression.compressPreferredEncodings
(List<String> encodings) Specifies a list of encodings for response compression in preferred order.decompressExcludeEncoding
(String encoding) decompressExcludeMethod
(String method) decompressExcludeMimeType
(String mimetype) decompressExcludePath
(String pathSpecString) A path spec to exclude for request decompression.decompressIncludeEncoding
(String encoding) decompressIncludeMethod
(String method) decompressIncludeMimeType
(String mimetype) decompressIncludePath
(String pathSpecString) A path spec to include for request decompression.defaults()
Configures thisBuilder
with the default configuration.
-
Method Details
-
compressExcludeEncoding
- Parameters:
encoding
- the encoding to exclude for response compression.- Returns:
- this builder
-
compressExcludeMethod
- Parameters:
method
- the HTTP method to exclude for response compression- Returns:
- this builder
-
compressExcludeMimeType
- Parameters:
mimetype
- the MIME type to exclude for response compression- Returns:
- this builder
-
compressExcludePath
A path spec to exclude for response compression.
The path spec is matched against
Request.getPathInContext(Request)
.- Parameters:
pathSpecString
- the path spec to exclude for response compression.- Returns:
- this builder
- See Also:
-
compressIncludeEncoding
- Parameters:
encoding
- the encoding to include for response compression.- Returns:
- this builder
-
compressIncludeMethod
- Parameters:
method
- the HTTP method to include for response compression- Returns:
- this builder
-
compressIncludeMimeType
- Parameters:
mimetype
- the MIME type to include for response compression- Returns:
- this builder
-
compressIncludePath
A path spec to include for response compression.
The path spec is matched against
Request.getPathInContext(Request)
.- Parameters:
pathSpecString
- the path spec to include for response compression.- Returns:
- this builder
- See Also:
-
compressPreferredEncodings
Specifies a list of encodings for response compression in preferred order.
This list is only used when
CompressionHandler
computes more than one candidate content encoding for response compression. This happens only whenAccept-Encoding
specifies more than one encoding, and they are all supported by the server, or whenAccept-Encoding
specifies the token*
and the server supports more than one encoding.- Parameters:
encodings
- a list of encodings for response compression in preferred order- Returns:
- this builder
-
decompressExcludeEncoding
- Parameters:
encoding
- the encoding to exclude for request decompression- Returns:
- this builder
-
decompressExcludeMethod
- Parameters:
method
- the HTTP method to exclude for request decompression- Returns:
- this builder
-
decompressExcludeMimeType
- Parameters:
mimetype
- the MIME type to exclude for request decompression- Returns:
- this builder
-
decompressExcludePath
A path spec to exclude for request decompression.
The path spec is matched against
Request.getPathInContext(Request)
.- Parameters:
pathSpecString
- the path spec to exclude for request decompression- Returns:
- this builder
- See Also:
-
decompressIncludeEncoding
- Parameters:
encoding
- the encoding to include for request decompression- Returns:
- this builder
-
decompressIncludeMethod
- Parameters:
method
- the HTTP method to include for request decompression- Returns:
- this builder
-
decompressIncludeMimeType
- Parameters:
mimetype
- the MIME type to include for request decompression- Returns:
- this builder
-
decompressIncludePath
A path spec to include for request decompression.
The path spec is matched against
Request.getPathInContext(Request)
.- Parameters:
pathSpecString
- the path spec to include for request decompression- Returns:
- this builder
- See Also:
-
defaults
Configures this
Builder
with the default configuration.Additional configuration may be specified using the
Builder
methods, possibly overriding the defaults.- Returns:
- this builder
-
build
- Returns:
- a new
CompressionConfig
instance configured with thisBuilder
.
-