Package org.apache.coyote
Class CompressionConfig
- java.lang.Object
- 
- org.apache.coyote.CompressionConfig
 
- 
 public class CompressionConfig extends java.lang.Object
- 
- 
Constructor SummaryConstructors Constructor Description CompressionConfig()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.StringgetCompressibleMimeType()java.lang.String[]getCompressibleMimeTypes()java.lang.StringgetCompression()Return compression level.intgetCompressionLevel()intgetCompressionMinSize()booleangetNoCompressionStrongETag()Deprecated.Will be removed in Tomcat 10 where it will be hard-coded totruejava.lang.StringgetNoCompressionUserAgents()Obtain the String form of the regular expression that defines the user agents to not use gzip with.java.util.regex.PatterngetNoCompressionUserAgentsPattern()voidsetCompressibleMimeType(java.lang.String valueS)voidsetCompression(java.lang.String compression)Set compression level.voidsetCompressionMinSize(int compressionMinSize)Set Minimum size to trigger compression.voidsetNoCompressionStrongETag(boolean noCompressionStrongETag)Deprecated.Will be removed in Tomcat 10 where it will be hard-coded totruevoidsetNoCompressionUserAgents(java.lang.String noCompressionUserAgents)Set no compression user agent pattern.booleanuseCompression(Request request, Response response)Determines if compression should be enabled for the given response and if it is, sets any necessary headers to mark it as such.
 
- 
- 
- 
Method Detail- 
setCompressionpublic void setCompression(java.lang.String compression) Set compression level.- Parameters:
- compression- One of- on,- force,- offor the minimum compression size in bytes which implies- on
 
 - 
getCompressionpublic java.lang.String getCompression() Return compression level.- Returns:
- The current compression level in string form (off/on/force)
 
 - 
getCompressionLevelpublic int getCompressionLevel() 
 - 
getNoCompressionUserAgentspublic java.lang.String getNoCompressionUserAgents() Obtain the String form of the regular expression that defines the user agents to not use gzip with.- Returns:
- The regular expression as a String
 
 - 
getNoCompressionUserAgentsPatternpublic java.util.regex.Pattern getNoCompressionUserAgentsPattern() 
 - 
setNoCompressionUserAgentspublic void setNoCompressionUserAgents(java.lang.String noCompressionUserAgents) Set no compression user agent pattern. Regular expression as supported byPattern. e.g.:gorilla|desesplorer|tigrus.- Parameters:
- noCompressionUserAgents- The regular expression for user agent strings for which compression should not be applied
 
 - 
getCompressibleMimeTypepublic java.lang.String getCompressibleMimeType() 
 - 
setCompressibleMimeTypepublic void setCompressibleMimeType(java.lang.String valueS) 
 - 
getCompressibleMimeTypespublic java.lang.String[] getCompressibleMimeTypes() 
 - 
getCompressionMinSizepublic int getCompressionMinSize() 
 - 
setCompressionMinSizepublic void setCompressionMinSize(int compressionMinSize) Set Minimum size to trigger compression.- Parameters:
- compressionMinSize- The minimum content length required for compression in bytes
 
 - 
getNoCompressionStrongETag@Deprecated public boolean getNoCompressionStrongETag() Deprecated.Will be removed in Tomcat 10 where it will be hard-coded totrueDetermine if compression is disabled if the resource has a strong ETag.- Returns:
- trueif compression is disabled, otherwise- false
 
 - 
setNoCompressionStrongETag@Deprecated public void setNoCompressionStrongETag(boolean noCompressionStrongETag) Deprecated.Will be removed in Tomcat 10 where it will be hard-coded totrueSet whether compression is disabled for resources with a strong ETag.- Parameters:
- noCompressionStrongETag-- trueif compression is disabled, otherwise- false
 
 - 
useCompressionpublic boolean useCompression(Request request, Response response) Determines if compression should be enabled for the given response and if it is, sets any necessary headers to mark it as such.- Parameters:
- request- The request that triggered the response
- response- The response to consider compressing
- Returns:
- trueif compression was enabled for the given response, otherwise- false
 
 
- 
 
-