java.lang.Object
org.htmlunit.util.HeaderUtils
Utility class for HTTP header analysis.
- Author:
- Anton Demydenko, Lai Quang Duong, Ronald Brill
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleancontainsETag(WebResponse response) Returns whether theETagheader is present.static booleancontainsLastModified(WebResponse response) Returns whether theLast-Modifiedheader is present.static booleancontainsMaxAge(WebResponse response) Returns whether theCache-Controlheader is present and contains themax-agedirective.static booleancontainsMaxAgeOrSMaxage(WebResponse response) Returns whether theCache-Controlheader is present and contains either themax-ageor thes-maxagedirective.static booleancontainsNoCache(WebResponse response) Returns whether theCache-Controlheader is present and contains theno-cachedirective.static booleancontainsNoStore(WebResponse response) Returns whether theCache-Controlheader is present and contains theno-storedirective.static booleancontainsPrivate(WebResponse response) Returns whether theCache-Controlheader is present and contains theprivatedirective.static booleancontainsPublic(WebResponse response) Returns whether theCache-Controlheader is present and contains thepublicdirective.static booleancontainsSMaxage(WebResponse response) Returns whether theCache-Controlheader is present and contains thes-maxagedirective.static longmaxAge(WebResponse response) Returns the value of themax-agedirective, or0if it is absent.static longsMaxage(WebResponse response) Returns the value of thes-maxagedirective, or0if it is absent.
-
Method Details
-
containsPrivate
Returns whether theCache-Controlheader is present and contains theprivatedirective.- Parameters:
response- theWebResponseto check- Returns:
trueif theCache-Controlheader containsprivate
-
containsPublic
Returns whether theCache-Controlheader is present and contains thepublicdirective.- Parameters:
response- theWebResponseto check- Returns:
trueif theCache-Controlheader containspublic
-
containsNoStore
Returns whether theCache-Controlheader is present and contains theno-storedirective.- Parameters:
response- theWebResponseto check- Returns:
trueif theCache-Controlheader containsno-store
-
containsNoCache
Returns whether theCache-Controlheader is present and contains theno-cachedirective.- Parameters:
response- theWebResponseto check- Returns:
trueif theCache-Controlheader containsno-cache
-
containsETag
Returns whether theETagheader is present.- Parameters:
response- theWebResponseto check- Returns:
trueif theETagheader is present
-
containsLastModified
Returns whether theLast-Modifiedheader is present.- Parameters:
response- theWebResponseto check- Returns:
trueif theLast-Modifiedheader is present
-
containsSMaxage
Returns whether theCache-Controlheader is present and contains thes-maxagedirective.- Parameters:
response- theWebResponseto check- Returns:
trueif theCache-Controlheader containss-maxage
-
containsMaxAge
Returns whether theCache-Controlheader is present and contains themax-agedirective.- Parameters:
response- theWebResponseto check- Returns:
trueif theCache-Controlheader containsmax-age
-
containsMaxAgeOrSMaxage
Returns whether theCache-Controlheader is present and contains either themax-ageor thes-maxagedirective.- Parameters:
response- theWebResponseto check- Returns:
trueif theCache-Controlheader containsmax-ageors-maxage
-
sMaxage
Returns the value of thes-maxagedirective, or0if it is absent.- Parameters:
response- theWebResponseto check- Returns:
- the value of the
s-maxagedirective, or0
-
maxAge
Returns the value of themax-agedirective, or0if it is absent.- Parameters:
response- theWebResponseto check- Returns:
- the value of the
max-agedirective, or0
-