Class RFC2109Spec
java.lang.Object
org.apache.commons.httpclient.cookie.CookieSpecBase
org.apache.commons.httpclient.cookie.RFC2109Spec
- All Implemented Interfaces:
CookieSpec
RFC 2109 specific cookie management functions
- Since:
- 2.0
- Author:
- B.C. Holmes, Park, Sung-Gu, Doug Sale, Rod Waldhoff, dIon Gillard, Sean C. Sullivan, John Evans, Marc A. Saegesser, Oleg Kalnichevski, Mike Bowler
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringCookie Response Header name for cookies processed by this spec.Fields inherited from class CookieSpecBase
LOGFields inherited from interface CookieSpec
PATH_DELIM, PATH_DELIM_CHAR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleandomainMatch(String host, String domain) Performs domain-match as defined by the RFC2109.formatCookie(Cookie cookie) Return a string suitable for sending in a "Cookie" header as defined in RFC 2109formatCookies(Cookie[] cookies) Create a RFC 2109 compliant "Cookie" header value containing allCookies in cookies suitable for sending in a "Cookie" headervoidparseAttribute(NameValuePair attribute, Cookie cookie) Parse RFC 2109 specific cookie attribute and update the corresponsingCookieproperties.voidPerforms RFC 2109 compliantCookievalidationMethods inherited from class CookieSpecBase
formatCookieHeader, formatCookieHeader, getValidDateFormats, match, match, parse, parse, pathMatch, setValidDateFormats
-
Field Details
-
SET_COOKIE_KEY
Cookie Response Header name for cookies processed by this spec.- See Also:
-
-
Constructor Details
-
RFC2109Spec
public RFC2109Spec()Default constructor
-
-
Method Details
-
parseAttribute
Parse RFC 2109 specific cookie attribute and update the corresponsingCookieproperties.- Specified by:
parseAttributein interfaceCookieSpec- Overrides:
parseAttributein classCookieSpecBase- Parameters:
attribute-NameValuePaircookie attribute from the Set- Cookiecookie-Cookieto be updated- Throws:
MalformedCookieException- if an exception occurs during parsing
-
validate
public void validate(String host, int port, String path, boolean secure, Cookie cookie) throws MalformedCookieException Performs RFC 2109 compliantCookievalidation- Specified by:
validatein interfaceCookieSpec- Overrides:
validatein classCookieSpecBase- Parameters:
host- the host from which theCookiewas receivedport- the port from which theCookiewas receivedpath- the path from which theCookiewas receivedsecure- true when theCookiewas received using a secure connectioncookie- The cookie to validate- Throws:
MalformedCookieException- if an exception occurs during validation
-
domainMatch
Performs domain-match as defined by the RFC2109.- Specified by:
domainMatchin interfaceCookieSpec- Overrides:
domainMatchin classCookieSpecBase- Parameters:
host- The target host.domain- The cookie domain attribute.- Returns:
- true if the specified host matches the given domain.
- Since:
- 3.0
-
formatCookie
Return a string suitable for sending in a "Cookie" header as defined in RFC 2109- Specified by:
formatCookiein interfaceCookieSpec- Overrides:
formatCookiein classCookieSpecBase- Parameters:
cookie- aCookieto be formatted as string- Returns:
- a string suitable for sending in a "Cookie" header.
-
formatCookies
Create a RFC 2109 compliant "Cookie" header value containing allCookies in cookies suitable for sending in a "Cookie" header- Specified by:
formatCookiesin interfaceCookieSpec- Overrides:
formatCookiesin classCookieSpecBase- Parameters:
cookies- an array ofCookies to be formatted- Returns:
- a string suitable for sending in a Cookie header.
-