Package org.eclipse.jetty.http
Class CompressedContentFormat
- java.lang.Object
-
- org.eclipse.jetty.http.CompressedContentFormat
-
public class CompressedContentFormat extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static CompressedContentFormat
BR
static java.lang.String
ETAG_SEPARATOR
The separator within an etag used to indicate a compressed variant.static CompressedContentFormat
GZIP
static CompressedContentFormat[]
NONE
-
Constructor Summary
Constructors Constructor Description CompressedContentFormat(java.lang.String encoding, java.lang.String extension)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
java.lang.String
etag(java.lang.String etag)
Get an etag with suffix that represents this compressed type.HttpField
getContentEncoding()
java.lang.String
getEncoding()
java.lang.String
getEtagSuffix()
java.lang.String
getExtension()
int
hashCode()
java.lang.String
stripSuffixes(java.lang.String etagsList)
static boolean
tagEquals(java.lang.String etag, java.lang.String etagWithSuffix)
Check etags for equality, accounting for quoting and compression suffixes.java.lang.String
toString()
-
-
-
Field Detail
-
ETAG_SEPARATOR
public static final java.lang.String ETAG_SEPARATOR
The separator within an etag used to indicate a compressed variant. By default the separator is "--" So etag for compressed resource that normally has an etag ofW/"28c772d6"
isW/"28c772d6--gzip"
. The separator may be changed by the "org.eclipse.jetty.http.CompressedContentFormat.ETAG_SEPARATOR" System property. If changed, it should be changed to a string that will not be found in a normal etag or at least is very unlikely to be a substring of a normal etag.
-
GZIP
public static final CompressedContentFormat GZIP
-
BR
public static final CompressedContentFormat BR
-
NONE
public static final CompressedContentFormat[] NONE
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
getEncoding
public java.lang.String getEncoding()
-
getExtension
public java.lang.String getExtension()
-
getEtagSuffix
public java.lang.String getEtagSuffix()
-
getContentEncoding
public HttpField getContentEncoding()
-
etag
public java.lang.String etag(java.lang.String etag)
Get an etag with suffix that represents this compressed type.- Parameters:
etag
- An etag- Returns:
- An etag with compression suffix, or the etag itself if no suffix is configured.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
tagEquals
public static boolean tagEquals(java.lang.String etag, java.lang.String etagWithSuffix)
Check etags for equality, accounting for quoting and compression suffixes.- Parameters:
etag
- An etag without a compression suffixetagWithSuffix
- An etag optionally with a compression suffix.- Returns:
- True if the tags are equal.
-
stripSuffixes
public java.lang.String stripSuffixes(java.lang.String etagsList)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-