public class RFC2109Spec extends CookieSpecBase
RFC 2109 specific cookie management functions
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SET_COOKIE_KEY
Cookie Response Header name for cookies processed
by this spec.
|
LOG
PATH_DELIM, PATH_DELIM_CHAR
Constructor and Description |
---|
RFC2109Spec()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
domainMatch(java.lang.String host,
java.lang.String domain)
Performs domain-match as defined by the RFC2109.
|
java.lang.String |
formatCookie(Cookie cookie)
Return a string suitable for sending in a "Cookie" header as
defined in RFC 2109
|
java.lang.String |
formatCookies(Cookie[] cookies)
Create a RFC 2109 compliant "Cookie" header value containing all
Cookie s in cookies suitable for sending in a "Cookie"
header |
void |
parseAttribute(NameValuePair attribute,
Cookie cookie)
Parse RFC 2109 specific cookie attribute and update the corresponsing
Cookie properties. |
void |
validate(java.lang.String host,
int port,
java.lang.String path,
boolean secure,
Cookie cookie)
Performs RFC 2109 compliant
Cookie validation |
formatCookieHeader, formatCookieHeader, getValidDateFormats, match, match, parse, parse, pathMatch, setValidDateFormats
public static final java.lang.String SET_COOKIE_KEY
public void parseAttribute(NameValuePair attribute, Cookie cookie) throws MalformedCookieException
Cookie
properties.parseAttribute
in interface CookieSpec
parseAttribute
in class CookieSpecBase
attribute
- NameValuePair
cookie attribute from the
Set- Cookiecookie
- Cookie
to be updatedMalformedCookieException
- if an exception occurs during parsingpublic void validate(java.lang.String host, int port, java.lang.String path, boolean secure, Cookie cookie) throws MalformedCookieException
Cookie
validationvalidate
in interface CookieSpec
validate
in class CookieSpecBase
host
- the host from which the Cookie
was receivedport
- the port from which the Cookie
was receivedpath
- the path from which the Cookie
was receivedsecure
- true when the Cookie
was received using a
secure connectioncookie
- The cookie to validateMalformedCookieException
- if an exception occurs during
validationpublic boolean domainMatch(java.lang.String host, java.lang.String domain)
domainMatch
in interface CookieSpec
domainMatch
in class CookieSpecBase
host
- The target host.domain
- The cookie domain attribute.public java.lang.String formatCookie(Cookie cookie)
formatCookie
in interface CookieSpec
formatCookie
in class CookieSpecBase
cookie
- a Cookie
to be formatted as stringpublic java.lang.String formatCookies(Cookie[] cookies)
Cookie
s in cookies suitable for sending in a "Cookie"
headerformatCookies
in interface CookieSpec
formatCookies
in class CookieSpecBase
cookies
- an array of Cookie
s to be formattedCopyright © 2001-2012 Apache Software Foundation. All Rights Reserved.