Top Fields Constructors Methods
org.eclipse.jetty.server.handler.gzip

public Class GzipHandler

extends Wrapper
implements GzipFactory
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.server.handler.gzip.GzipFactory
Imports
java.util.ListIterator, .Set, java.util.zip.Deflater, org.eclipse.jetty.http.EtagUtils, .HttpField, .HttpFields, .HttpHeader, .HttpMethod, .MimeTypes, .PreEncodedHttpField, org.eclipse.jetty.http.pathmap.PathSpecSet, org.eclipse.jetty.server.Handler, .Request, .Response, .Server, org.eclipse.jetty.util.AsciiLowerCaseSet, .Callback, .IncludeExclude, .StringUtil, org.eclipse.jetty.util.compression.DeflaterPool, .InflaterPool, org.slf4j.Logger, .LoggerFactory

Field Summary

Modifier and TypeField and Description
private DeflaterPool
private int
private final IncludeExclude<String>
private InflaterPool
private final IncludeExclude<String>
private final IncludeExclude<String>
private int
private final IncludeExclude<String>
private boolean
private HttpField
public static final int
public static final int
public static final String
public static final String
public static final String
private static final Logger

Constructor Summary

AccessConstructor and Description
public
GzipHandler()

Instantiates a new GzipHandler.

public
GzipHandler(Handler
the handler to wrap
handler
)

Instantiates a new GzipHandler.

Method Summary

Modifier and TypeMethod and Description
public void
addExcludedInflationPaths(String...
Path specs (as per servlet spec) to exclude. If a ServletContext is available, the paths are relative to the context path, otherwise they are absolute.
For backward compatibility the pathspecs may be comma separated strings, but this will not be supported in future versions.
pathspecs
)

Adds excluded Path Specs for request filtering on request inflation.

public void
addExcludedMethods(String...
The methods to exclude in compression
methods
)

Add excluded to the HTTP methods filtering.

public void
addExcludedMimeTypes(String...
The mime types to exclude (without charset or other parameters).
types
)

Adds excluded MIME types for response filtering.

public void
addExcludedPaths(String...
Path specs (as per servlet spec) to exclude. If a ServletContext is available, the paths are relative to the context path, otherwise they are absolute.
For backward compatibility the pathspecs may be comma separated strings, but this will not be supported in future versions.
pathspecs
)

Adds excluded Path Specs for request filtering.

public void
addIncludedInflationPaths(String...
Path specs (as per servlet spec) to include. If a ServletContext is available, the paths are relative to the context path, otherwise they are absolute
pathspecs
)

Add included Path Specs for filtering on request inflation.

public void
addIncludedMethods(String...
The HTTP methods to include in compression.
methods
)

Adds included HTTP Methods (eg: POST, PATCH, DELETE) for filtering.

public void
addIncludedMimeTypes(String...
The mime types to include (without charset or other parameters) For backward compatibility the mimetypes may be comma separated strings, but this will not be supported in future versions.
types
)

Add included MIME types for response filtering

public void
addIncludedPaths(String...
Path specs (as per servlet spec) to include. If a ServletContext is available, the paths are relative to the context path, otherwise they are absolute
pathspecs
)

Add included Path Specs for filtering.

protected void
doStart()

Overrides org.eclipse.jetty.server.Handler.Abstract.doStart.

Starts the managed lifecycle beans in the order they were added.

protected void
doStop()

Overrides org.eclipse.jetty.server.Handler.Abstract.doStop.

Stops the managed lifecycle beans in the reverse order they were added.

public CompressionPool<Deflater>.Entry
public DeflaterPool

Returns:

the DeflaterPool being used.
getDeflaterPool
()

Get the DeflaterPool being used.

public String[]

Returns:

the filter list of excluded Path Specs
getExcludedInflationPaths
()

Get the current filter list of excluded Path Specs for request inflation.

public String

Returns:

the excluded filter list of HTTP methods in CSV format
getExcludedMethodList
()

Get the excluded filter list of HTTP methods in CSV format

public String[]

Returns:

the filter list of excluded HTTP methods
getExcludedMethods
()

Get the current filter list of excluded HTTP methods

public String[]

Returns:

the filter list of excluded MIME types
getExcludedMimeTypes
()

Get the current filter list of excluded MIME types

public String[]

Returns:

the filter list of excluded Path Specs
getExcludedPaths
()

Get the current filter list of excluded Path Specs

public String[]

Returns:

the filter list of included Path Specs
getIncludedInflationPaths
()

Get the current filter list of included Path Specs for request inflation.

public String

Returns:

the included filter list of HTTP methods in CSV format
getIncludedMethodList
()

Get the included filter list of HTTP methods in CSV format

public String[]

Returns:

the filter list of included HTTP methods
getIncludedMethods
()

Get the current filter list of included HTTP Methods

public String[]

Returns:

the filter list of included MIME types
getIncludedMimeTypes
()

Get the current filter list of included MIME types

public String[]

Returns:

the filter list of included Path Specs
getIncludedPaths
()

Get the current filter list of included Path Specs

public int

Returns:

size in bytes of the buffer, or 0 for no inflation.
getInflateBufferSize
()

Get the size (in bytes) of the java.util.zip.Inflater buffer used to inflate compressed requests.

public InflaterPool

Returns:

the DeflaterPool being used.
getInflaterPool
()

Get the InflaterPool being used.

public int

Returns:

minimum response size (in bytes) that triggers compression
getMinGzipSize
()

Get the minimum size, in bytes, that a response Content-Length must be before compression will trigger.

public HttpField
getVary()

Returns: The VARY field to use.

public boolean
handle(Request
the HTTP request to handle
request
,
Response
the HTTP response to handle
response
,
Callback
the callback to complete when the handling is complete
callback
)

Overrides org.eclipse.jetty.server.Handler.Wrapper.handle.

Implements org.eclipse.jetty.server.Request.Handler.handle.

Invoked to handle the passed HTTP request and response.

protected boolean
isMimeTypeDeflatable(MimeTypes mimeTypes, String requestURI)

public boolean

Returns:

true if allowed, false otherwise
isMimeTypeDeflatable
(String
the MIME type to test
mimetype
)

Implements org.eclipse.jetty.server.handler.gzip.GzipFactory.isMimeTypeDeflatable.

Test if the provided MIME type is allowed based on the MIME type filters.

protected boolean

Returns:

whether compressing is allowed for the given the path
isPathDeflatable
(String
the request uri
requestURI
)

Test if the provided Request URI is allowed based on the Path Specs filters.

protected boolean

Returns:

whether decompressing is allowed for the given the path.
isPathInflatable
(String
the request path in context
pathInContext
)

Test if the provided Request URI is allowed to be inflated based on the Path Specs filters.

public boolean

Returns:

True if Deflater#SYNC_FLUSH is used, else Deflater#NO_FLUSH
isSyncFlush
()

Is the Deflater running Deflater#SYNC_FLUSH or not.

public void
setDeflaterPool(DeflaterPool
the DeflaterPool to use.
deflaterPool
)

Set the DeflaterPool to be used.

public void
setExcludedInflatePaths(String...
Path specs (as per servlet spec) to exclude from inflation. If a ServletContext is available, the paths are relative to the context path, otherwise they are absolute.
pathspecs
)

Set the excluded filter list of Path specs (replacing any previously set)

public void
setExcludedMethodList(String
the list of methods, CSV format
csvMethods
)

Set the excluded filter list of HTTP Methods (replacing any previously set)

public void
setExcludedMethods(String...
the HTTP methods to exclude
methods
)

Set the excluded filter list of HTTP methods (replacing any previously set)

public void
setExcludedMimeTypes(String...
The mime types to exclude (without charset or other parameters)
types
)

Set the excluded filter list of MIME types (replacing any previously set)

public void
setExcludedMimeTypesList(String
The list of mime types to exclude (without charset or other parameters), CSV format
csvTypes
)

Set the excluded filter list of MIME types (replacing any previously set)

public void
setExcludedPaths(String...
Path specs (as per servlet spec) to exclude. If a ServletContext is available, the paths are relative to the context path, otherwise they are absolute.
pathspecs
)

Set the excluded filter list of Path specs (replacing any previously set)

public void
setIncludedInflatePaths(String...
Path specs (as per servlet spec) to include for inflation. If a ServletContext is available, the paths are relative to the context path, otherwise they are absolute
pathspecs
)

Set the included filter list of Path specs (replacing any previously set)

public void
setIncludedMethodList(String
the list of methods, CSV format
csvMethods
)

Set the included filter list of HTTP Methods (replacing any previously set)

public void
setIncludedMethods(String...
The methods to include in compression
methods
)

Set the included filter list of HTTP methods (replacing any previously set)

public void
setIncludedMimeTypes(String...
The mime types to include (without charset or other parameters)
types
)

Set the included filter list of MIME types (replacing any previously set)

public void
setIncludedMimeTypesList(String
The list of mime types to include (without charset or other parameters), CSV format
csvTypes
)

Set the included filter list of MIME types (replacing any previously set)

public void
setIncludedPaths(String...
Path specs (as per servlet spec) to include. If a ServletContext is available, the paths are relative to the context path, otherwise they are absolute
pathspecs
)

Set the included filter list of Path specs (replacing any previously set)

public void
setInflateBufferSize(int
size in bytes of the buffer, or 0 for no inflation.
size
)

Set the size (in bytes) of the java.util.zip.Inflater buffer used to inflate comrpessed requests.

public void
setInflaterPool(InflaterPool
the InflaterPool to use.
inflaterPool
)

Set the InflaterPool to be used.

public void
setMinGzipSize(int
minimum response size in bytes (not allowed to be lower then BREAK_EVEN_GZIP_SIZE)
minGzipSize
)

Set the minimum response size to trigger dynamic compression.

public void
setSyncFlush(boolean syncFlush)

Set the Deflater flush mode to use.

public void
setVary(HttpField
The VARY field to use. It if is not an instance of PreEncodedHttpField, then it will be converted to one.
vary
)

public String
toString()

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.toString.

Returns a string representation of the object.

Inherited from org.eclipse.jetty.server.Handler.Wrapper:
getHandlergetInvocationTypesetHandler

Field Detail

_deflaterPoolback to summary
private DeflaterPool _deflaterPool
_inflateBufferSizeback to summary
private int _inflateBufferSize
_inflatePathsback to summary
private final IncludeExclude<String> _inflatePaths
_inflaterPoolback to summary
private InflaterPool _inflaterPool
_methodsback to summary
private final IncludeExclude<String> _methods
_mimeTypesback to summary
private final IncludeExclude<String> _mimeTypes
_minGzipSizeback to summary
private int _minGzipSize
_pathsback to summary
private final IncludeExclude<String> _paths
_syncFlushback to summary
private boolean _syncFlush
_varyback to summary
private HttpField _vary
BREAK_EVEN_GZIP_SIZEback to summary
public static final int BREAK_EVEN_GZIP_SIZE
DEFAULT_MIN_GZIP_SIZEback to summary
public static final int DEFAULT_MIN_GZIP_SIZE
DEFLATEback to summary
public static final String DEFLATE
GZIPback to summary
public static final String GZIP
GZIP_HANDLER_ETAGSback to summary
public static final String GZIP_HANDLER_ETAGS
LOGback to summary
private static final Logger LOG

Hides org.eclipse.jetty.server.Handler.Abstract.LOG.

Constructor Detail

GzipHandlerback to summary
public GzipHandler()

Instantiates a new GzipHandler.

GzipHandlerback to summary
public GzipHandler(Handler handler)

Instantiates a new GzipHandler.

Parameters
handler:Handler

the handler to wrap

Method Detail

addExcludedInflationPathsback to summary
public void addExcludedInflationPaths(String... pathspecs)

Adds excluded Path Specs for request filtering on request inflation.

There are 2 syntaxes supported, Servlet url-pattern based, and Regex based. This means that the initial characters on the path spec line are very strict, and determine the behavior of the path matching.

  • 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

Note

inclusion takes precedence over exclude.

Parameters
pathspecs:String[]

Path specs (as per servlet spec) to exclude. If a ServletContext is available, the paths are relative to the context path, otherwise they are absolute.
For backward compatibility the pathspecs may be comma separated strings, but this will not be supported in future versions.

See Also
addIncludedInflationPaths(String...)
addExcludedMethodsback to summary
public void addExcludedMethods(String... methods)

Add excluded to the HTTP methods filtering.

Parameters
methods:String[]

The methods to exclude in compression

See Also
addIncludedMethods(String...)
addExcludedMimeTypesback to summary
public void addExcludedMimeTypes(String... types)

Adds excluded MIME types for response filtering.

Deprecation Warning: For backward compatibility the MIME types parameters may be comma separated strings, but this will not be supported in future versions of Jetty.

Parameters
types:String[]

The mime types to exclude (without charset or other parameters).

See Also
addIncludedMimeTypes(String...)
addExcludedPathsback to summary
public void addExcludedPaths(String... pathspecs)

Adds excluded Path Specs for request filtering.

There are 2 syntaxes supported, Servlet url-pattern based, and Regex based. This means that the initial characters on the path spec line are very strict, and determine the behavior of the path matching.

  • 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

Note

inclusion takes precedence over exclude.

Parameters
pathspecs:String[]

Path specs (as per servlet spec) to exclude. If a ServletContext is available, the paths are relative to the context path, otherwise they are absolute.
For backward compatibility the pathspecs may be comma separated strings, but this will not be supported in future versions.

See Also
addIncludedPaths(String...)
addIncludedInflationPathsback to summary
public void addIncludedInflationPaths(String... pathspecs)

Add included Path Specs for filtering on request inflation.

There are 2 syntaxes supported, Servlet url-pattern based, and Regex based. This means that the initial characters on the path spec line are very strict, and determine the behavior of the path matching.

  • 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

Note

inclusion takes precedence over exclusion.

Parameters
pathspecs:String[]

Path specs (as per servlet spec) to include. If a ServletContext is available, the paths are relative to the context path, otherwise they are absolute

addIncludedMethodsback to summary
public void addIncludedMethods(String... methods)

Adds included HTTP Methods (eg: POST, PATCH, DELETE) for filtering.

Parameters
methods:String[]

The HTTP methods to include in compression.

See Also
addExcludedMethods(String...)
addIncludedMimeTypesback to summary
public void addIncludedMimeTypes(String... types)

Add included MIME types for response filtering

Parameters
types:String[]

The mime types to include (without charset or other parameters) For backward compatibility the mimetypes may be comma separated strings, but this will not be supported in future versions.

See Also
addExcludedMimeTypes(String...)
addIncludedPathsback to summary
public void addIncludedPaths(String... pathspecs)

Add included Path Specs for filtering.

There are 2 syntaxes supported, Servlet url-pattern based, and Regex based. This means that the initial characters on the path spec line are very strict, and determine the behavior of the path matching.

  • 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

Note

inclusion takes precedence over exclusion.

Parameters
pathspecs:String[]

Path specs (as per servlet spec) to include. If a ServletContext is available, the paths are relative to the context path, otherwise they are absolute

doStartback to summary
protected void doStart() throws Exception

Overrides org.eclipse.jetty.server.Handler.Abstract.doStart.

Doc from org.eclipse.jetty.util.component.ContainerLifeCycle.doStart.

Starts the managed lifecycle beans in the order they were added.

Annotations
@Override
Exceptions
Exception:

Doc from org.eclipse.jetty.util.component.AbstractLifeCycle.doStart.

If there was a problem starting. Will cause a transition to FAILED state

doStopback to summary
protected void doStop() throws Exception

Overrides org.eclipse.jetty.server.Handler.Abstract.doStop.

Doc from org.eclipse.jetty.util.component.ContainerLifeCycle.doStop.

Stops the managed lifecycle beans in the reverse order they were added.

Annotations
@Override
Exceptions
Exception:

Doc from org.eclipse.jetty.util.component.AbstractLifeCycle.doStop.

If there was a problem stopping. Will cause a transition to FAILED state

getDeflaterEntryback to summary
public CompressionPool<Deflater>.Entry getDeflaterEntry(Request request, long contentLength)

Implements org.eclipse.jetty.server.handler.gzip.GzipFactory.getDeflaterEntry.

Annotations
@Override
getDeflaterPoolback to summary
public DeflaterPool getDeflaterPool()

Get the DeflaterPool being used. The default value of this is null before starting, but after starting if it is null it will be set to the default DeflaterPool which is stored as a bean on the server.

Returns:DeflaterPool

the DeflaterPool being used.

getExcludedInflationPathsback to summary
public String[] getExcludedInflationPaths()

Get the current filter list of excluded Path Specs for request inflation.

Returns:String[]

the filter list of excluded Path Specs

See Also
getIncludedInflationPaths()
getExcludedMethodListback to summary
public String getExcludedMethodList()

Get the excluded filter list of HTTP methods in CSV format

Returns:String

the excluded filter list of HTTP methods in CSV format

See Also
getIncludedMethodList()
getExcludedMethodsback to summary
public String[] getExcludedMethods()

Get the current filter list of excluded HTTP methods

Returns:String[]

the filter list of excluded HTTP methods

See Also
getIncludedMethods()
getExcludedMimeTypesback to summary
public String[] getExcludedMimeTypes()

Get the current filter list of excluded MIME types

Returns:String[]

the filter list of excluded MIME types

See Also
getIncludedMimeTypes()
getExcludedPathsback to summary
public String[] getExcludedPaths()

Get the current filter list of excluded Path Specs

Returns:String[]

the filter list of excluded Path Specs

See Also
getIncludedPaths()
getIncludedInflationPathsback to summary
public String[] getIncludedInflationPaths()

Get the current filter list of included Path Specs for request inflation.

Returns:String[]

the filter list of included Path Specs

See Also
getExcludedInflationPaths()
getIncludedMethodListback to summary
public String getIncludedMethodList()

Get the included filter list of HTTP methods in CSV format

Returns:String

the included filter list of HTTP methods in CSV format

See Also
getExcludedMethodList()
getIncludedMethodsback to summary
public String[] getIncludedMethods()

Get the current filter list of included HTTP Methods

Returns:String[]

the filter list of included HTTP methods

See Also
getExcludedMethods()
getIncludedMimeTypesback to summary
public String[] getIncludedMimeTypes()

Get the current filter list of included MIME types

Returns:String[]

the filter list of included MIME types

See Also
getExcludedMimeTypes()
getIncludedPathsback to summary
public String[] getIncludedPaths()

Get the current filter list of included Path Specs

Returns:String[]

the filter list of included Path Specs

See Also
getExcludedPaths()
getInflateBufferSizeback to summary
public int getInflateBufferSize()

Get the size (in bytes) of the java.util.zip.Inflater buffer used to inflate compressed requests.

Returns:int

size in bytes of the buffer, or 0 for no inflation.

getInflaterPoolback to summary
public InflaterPool getInflaterPool()

Get the InflaterPool being used. The default value of this is null before starting, but after starting if it is null it will be set to the default InflaterPool which is stored as a bean on the server.

Returns:InflaterPool

the DeflaterPool being used.

getMinGzipSizeback to summary
public int getMinGzipSize()

Get the minimum size, in bytes, that a response Content-Length must be before compression will trigger.

Returns:int

minimum response size (in bytes) that triggers compression

See Also
setMinGzipSize(int)
getVaryback to summary
public HttpField getVary()
Returns:HttpField

The VARY field to use.

handleback to summary
public boolean handle(Request request, Response response, Callback callback) throws Exception

Overrides org.eclipse.jetty.server.Handler.Wrapper.handle.

Implements org.eclipse.jetty.server.Request.Handler.handle.

Doc from org.eclipse.jetty.server.Request.Handler.handle.

Invoked to handle the passed HTTP request and response.

The request is accepted by returning true, then handling must be concluded by completing the passed callback. The handling may be asynchronous, i.e. this method may return true and complete the given callback later, possibly from a different thread. If this method returns false, then the callback must not be invoked and any mutation on the response reversed.

Exceptions thrown by this method may be subsequently handled by an error Request.Handler, if present, otherwise a default HTTP 500 error is generated and the callback completed while writing the error response.

The simplest implementation is:

public boolean handle(Request request, Response response, Callback callback)
{
    callback.succeeded();
    return true;
}

A HelloWorld implementation is:

public boolean handle(Request request, Response response, Callback callback)
{
    response.write(true, ByteBuffer.wrap("Hello World\n".getBytes(StandardCharsets.UTF_8)), callback);
    return true;
}
Parameters
request:Request

the HTTP request to handle

response:Response

the HTTP response to handle

callback:Callback

the callback to complete when the handling is complete

Returns:boolean

True if and only if the request will be handled, a response generated and the callback eventually called. This may occur within the scope of the call to this method, or asynchronously some time later. If false is returned, then this method must not generate a response, nor complete the callback.

Annotations
@Override
Exceptions
Exception:
if there is a failure during the handling. Catchers cannot assume that the callback will be called and thus should attempt to complete the request as if a false had been returned.
isMimeTypeDeflatableback to summary
protected boolean isMimeTypeDeflatable(MimeTypes mimeTypes, String requestURI)
isMimeTypeDeflatableback to summary
public boolean isMimeTypeDeflatable(String mimetype)

Implements org.eclipse.jetty.server.handler.gzip.GzipFactory.isMimeTypeDeflatable.

Test if the provided MIME type is allowed based on the MIME type filters.

Parameters
mimetype:String

the MIME type to test

Returns:boolean

true if allowed, false otherwise

Annotations
@Override
isPathDeflatableback to summary
protected boolean isPathDeflatable(String requestURI)

Test if the provided Request URI is allowed based on the Path Specs filters.

Parameters
requestURI:String

the request uri

Returns:boolean

whether compressing is allowed for the given the path

isPathInflatableback to summary
protected boolean isPathInflatable(String pathInContext)

Test if the provided Request URI is allowed to be inflated based on the Path Specs filters.

Parameters
pathInContext:String

the request path in context

Returns:boolean

whether decompressing is allowed for the given the path.

isSyncFlushback to summary
public boolean isSyncFlush()

Is the Deflater running Deflater#SYNC_FLUSH or not.

Returns:boolean

True if Deflater#SYNC_FLUSH is used, else Deflater#NO_FLUSH

See Also
setSyncFlush(boolean)
setDeflaterPoolback to summary
public void setDeflaterPool(DeflaterPool deflaterPool)

Set the DeflaterPool to be used. This should be called before starting. If this value is null when starting the default pool will be used from the server.

Parameters
deflaterPool:DeflaterPool

the DeflaterPool to use.

setExcludedInflatePathsback to summary
public void setExcludedInflatePaths(String... pathspecs)

Set the excluded filter list of Path specs (replacing any previously set)

Parameters
pathspecs:String[]

Path specs (as per servlet spec) to exclude from inflation. If a ServletContext is available, the paths are relative to the context path, otherwise they are absolute.

See Also
setIncludedInflatePaths(String...)
setExcludedMethodListback to summary
public void setExcludedMethodList(String csvMethods)

Set the excluded filter list of HTTP Methods (replacing any previously set)

Parameters
csvMethods:String

the list of methods, CSV format

See Also
setIncludedMethodList(String)
setExcludedMethodsback to summary
public void setExcludedMethods(String... methods)

Set the excluded filter list of HTTP methods (replacing any previously set)

Parameters
methods:String[]

the HTTP methods to exclude

See Also
setIncludedMethods(String...)
setExcludedMimeTypesback to summary
public void setExcludedMimeTypes(String... types)

Set the excluded filter list of MIME types (replacing any previously set)

Parameters
types:String[]

The mime types to exclude (without charset or other parameters)

See Also
setIncludedMimeTypes(String...)
setExcludedMimeTypesListback to summary
public void setExcludedMimeTypesList(String csvTypes)

Set the excluded filter list of MIME types (replacing any previously set)

Parameters
csvTypes:String

The list of mime types to exclude (without charset or other parameters), CSV format

See Also
setIncludedMimeTypesList(String)
setExcludedPathsback to summary
public void setExcludedPaths(String... pathspecs)

Set the excluded filter list of Path specs (replacing any previously set)

Parameters
pathspecs:String[]

Path specs (as per servlet spec) to exclude. If a ServletContext is available, the paths are relative to the context path, otherwise they are absolute.

See Also
setIncludedPaths(String...)
setIncludedInflatePathsback to summary
public void setIncludedInflatePaths(String... pathspecs)

Set the included filter list of Path specs (replacing any previously set)

Parameters
pathspecs:String[]

Path specs (as per servlet spec) to include for inflation. If a ServletContext is available, the paths are relative to the context path, otherwise they are absolute

See Also
setExcludedInflatePaths(String...)
setIncludedMethodListback to summary
public void setIncludedMethodList(String csvMethods)

Set the included filter list of HTTP Methods (replacing any previously set)

Parameters
csvMethods:String

the list of methods, CSV format

See Also
setExcludedMethodList(String)
setIncludedMethodsback to summary
public void setIncludedMethods(String... methods)

Set the included filter list of HTTP methods (replacing any previously set)

Parameters
methods:String[]

The methods to include in compression

See Also
setExcludedMethods(String...)
setIncludedMimeTypesback to summary
public void setIncludedMimeTypes(String... types)

Set the included filter list of MIME types (replacing any previously set)

Parameters
types:String[]

The mime types to include (without charset or other parameters)

See Also
setExcludedMimeTypes(String...)
setIncludedMimeTypesListback to summary
public void setIncludedMimeTypesList(String csvTypes)

Set the included filter list of MIME types (replacing any previously set)

Parameters
csvTypes:String

The list of mime types to include (without charset or other parameters), CSV format

See Also
setExcludedMimeTypesList(String)
setIncludedPathsback to summary
public void setIncludedPaths(String... pathspecs)

Set the included filter list of Path specs (replacing any previously set)

Parameters
pathspecs:String[]

Path specs (as per servlet spec) to include. If a ServletContext is available, the paths are relative to the context path, otherwise they are absolute

See Also
setExcludedPaths(String...)
setInflateBufferSizeback to summary
public void setInflateBufferSize(int size)

Set the size (in bytes) of the java.util.zip.Inflater buffer used to inflate comrpessed requests.

Parameters
size:int

size in bytes of the buffer, or 0 for no inflation.

setInflaterPoolback to summary
public void setInflaterPool(InflaterPool inflaterPool)

Set the InflaterPool to be used. This should be called before starting. If this value is null when starting the default pool will be used from the server.

Parameters
inflaterPool:InflaterPool

the InflaterPool to use.

setMinGzipSizeback to summary
public void setMinGzipSize(int minGzipSize)

Set the minimum response size to trigger dynamic compression.

Sizes below BREAK_EVEN_GZIP_SIZE will result a compressed response that is larger than the original data.

Parameters
minGzipSize:int

minimum response size in bytes (not allowed to be lower then BREAK_EVEN_GZIP_SIZE)

setSyncFlushback to summary
public void setSyncFlush(boolean syncFlush)

Set the Deflater flush mode to use. Deflater#SYNC_FLUSH should be used if the application wishes to stream the data, but this may hurt compression performance.

Parameters
syncFlush:boolean

True if Deflater#SYNC_FLUSH is used, else Deflater#NO_FLUSH

See Also
isSyncFlush()
setVaryback to summary
public void setVary(HttpField vary)
Parameters
vary:HttpField

The VARY field to use. It if is not an instance of PreEncodedHttpField, then it will be converted to one.

toStringback to summary
public String toString()

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override