public final class HeaderUtils
extends java.lang.Object
HttpHeaders implementations.| Modifier and Type | Class and Description |
|---|---|
static class |
HeaderUtils.CookiesByNameIterator
An
Iterator of HttpCookiePair designed to iterate across multiple values of
HttpHeaderNames.COOKIE for a specific cookie-name. |
static class |
HeaderUtils.CookiesIterator
|
| Modifier and Type | Field and Description |
|---|---|
static java.util.function.BiFunction<? super java.lang.CharSequence,? super java.lang.CharSequence,java.lang.CharSequence> |
DEFAULT_HEADER_FILTER |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
domainMatches(java.lang.CharSequence requestDomain,
java.lang.CharSequence cookieDomain)
|
static boolean |
isSetCookieNameMatches(java.lang.CharSequence setCookieString,
java.lang.CharSequence setCookieName)
|
static boolean |
isTransferEncodingChunked(HttpHeaders headers)
Returns
true if headers indicates transfer-encoding chunked. |
static HttpCookiePair |
parseCookiePair(java.lang.CharSequence cookieString,
java.lang.CharSequence cookiePairName)
Parse a single cookie-pair from a
cookie-string.
|
static HttpSetCookie |
parseSetCookie(java.lang.CharSequence setCookieString,
java.lang.CharSequence setCookieName,
boolean validate)
Parse a
HttpSetCookie from a
set-cookie-string. |
static boolean |
pathMatches(java.lang.CharSequence requestPath,
java.lang.CharSequence cookiePath)
|
static java.lang.CharSequence |
removeCookiePairs(java.lang.CharSequence cookieString,
java.lang.CharSequence cookiePairName)
Remove a single cookie-pair for a
cookie-string.
|
public static final java.util.function.BiFunction<? super java.lang.CharSequence,? super java.lang.CharSequence,java.lang.CharSequence> DEFAULT_HEADER_FILTER
public static boolean isTransferEncodingChunked(HttpHeaders headers)
true if headers indicates transfer-encoding chunked.
The values of all HttpHeaderNames.TRANSFER_ENCODING headers are interpreted as comma-separated values,
with spaces between values trimmed. If any of these values is HttpHeaderValues.CHUNKED, this method
return true, otherwise it returns false.
headers - The HttpHeaders to check.headers indicates transfer-encoding chunked, false
otherwise.public static boolean domainMatches(java.lang.CharSequence requestDomain,
@Nullable
java.lang.CharSequence cookieDomain)
requestDomain - The domain from the request.cookieDomain - The domain from the cookie.true if there is a match.public static boolean pathMatches(java.lang.CharSequence requestPath,
@Nullable
java.lang.CharSequence cookiePath)
requestPath - The path from the request.cookiePath - The path from the cookie.true if there is a match.public static boolean isSetCookieNameMatches(java.lang.CharSequence setCookieString,
java.lang.CharSequence setCookieName)
setCookieString - The set-cookie-string.setCookieName - The cookie-name.true if a set-cookie-string's
cookie-name matches setCookieName.@Nullable public static HttpSetCookie parseSetCookie(java.lang.CharSequence setCookieString, java.lang.CharSequence setCookieName, boolean validate)
HttpSetCookie from a
set-cookie-string.setCookieString - The set-cookie-string.setCookieName - The cookie-name.validate - true to attempt extra validation.HttpSetCookie from a
set-cookie-string.@Nullable public static HttpCookiePair parseCookiePair(java.lang.CharSequence cookieString, java.lang.CharSequence cookiePairName)
cookieString - The cookie-string that may
contain multiple cookie-pairs.cookiePairName - The cookie-name identifying
the cookie-pairs to parse.cookiePairNamenull if no matches were found@Nullable
public static java.lang.CharSequence removeCookiePairs(java.lang.CharSequence cookieString,
java.lang.CharSequence cookiePairName)
cookieString - The cookie-string that may
contain multiple cookie-pairs.cookiePairName - The cookie-name identifying
the cookie-pairs to remove.cookiePairNamecookiePairNamenull if none of the cookie-pairs
matched cookiePairName