| java.lang.Object org.apache.commons.httpclient.cookie.CookieSpecBase
Field Summary | |
final protected static Log | LOG |
Method Summary | |
public boolean | domainMatch(String host, String domain) Performs domain-match as implemented in common browsers.
Parameters: host - The target host. Parameters: domain - The cookie domain attribute. | public String | formatCookie(Cookie cookie) | public Header | formatCookieHeader(Cookie[] cookies) Create a "Cookie"
Header containing all
Cookie s
in cookies. | public Header | formatCookieHeader(Cookie cookie) Create a "Cookie"
Header containing the
Cookie . | public String | formatCookies(Cookie[] cookies) | public Collection | getValidDateFormats() | public boolean | match(String host, int port, String path, boolean secure, Cookie cookie) Return true if the cookie should be submitted with a request
with given attributes, false otherwise. | public Cookie[] | match(String host, int port, String path, boolean secure, Cookie cookies) Return an array of
Cookie s that should be submitted with a
request with given attributes, false otherwise. | public Cookie[] | match(String host, int port, String path, boolean secure, SortedMap cookies) Return an array of
Cookie s that should be submitted with a
request with given attributes, false otherwise. | public Cookie[] | parse(String host, int port, String path, boolean secure, String header) Parses the Set-Cookie value into an array of Cookies. | public Cookie[] | parse(String host, int port, String path, boolean secure, Header header) Parse the "Set-Cookie"
Header into an array of
Cookie s. | public void | parseAttribute(NameValuePair attribute, Cookie cookie) Parse the cookie attribute and update the corresponsing
Cookie properties. | public boolean | pathMatch(String path, String topmostPath) Performs path-match as implemented in common browsers.
Parameters: path - The target path. Parameters: topmostPath - The cookie path attribute. | public void | setValidDateFormats(Collection datepatterns) | public void | validate(String host, int port, String path, boolean secure, Cookie cookie) |
LOG | final protected static Log LOG(Code) | | Log object
|
CookieSpecBase | public CookieSpecBase()(Code) | | Default constructor
|
domainMatch | public boolean domainMatch(String host, String domain)(Code) | | Performs domain-match as implemented in common browsers.
Parameters: host - The target host. Parameters: domain - The cookie domain attribute. true if the specified host matches the given domain. |
formatCookie | public String formatCookie(Cookie cookie)(Code) | | Return a string suitable for sending in a "Cookie" header
Parameters: cookie - a Cookie to be formatted as string a string suitable for sending in a "Cookie" header. |
formatCookieHeader | public Header formatCookieHeader(Cookie[] cookies)(Code) | | Create a "Cookie"
Header containing all
Cookie s
in cookies.
Parameters: cookies - an array of Cookies to be formatted as a "Cookie" header a "Cookie" Header. |
formatCookieHeader | public Header formatCookieHeader(Cookie cookie)(Code) | | Create a "Cookie"
Header containing the
Cookie .
Parameters: cookie - Cookies to be formatted as a Cookieheader a Cookie header. |
match | public boolean match(String host, int port, String path, boolean secure, Cookie cookie)(Code) | | Return true if the cookie should be submitted with a request
with given attributes, false otherwise.
Parameters: host - the host to which the request is being submitted Parameters: port - the port to which the request is being submitted (ignored) Parameters: path - the path to which the request is being submitted Parameters: secure - true if the request is using a secure connection Parameters: cookie - Cookie to be matched true if the cookie matches the criterium |
match | public Cookie[] match(String host, int port, String path, boolean secure, Cookie cookies)(Code) | | Return an array of
Cookie s that should be submitted with a
request with given attributes, false otherwise.
Parameters: host - the host to which the request is being submitted Parameters: port - the port to which the request is being submitted (currentlyignored) Parameters: path - the path to which the request is being submitted Parameters: secure - true if the request is using a secure protocol Parameters: cookies - an array of Cookies to be matched an array of Cookies matching the criterium// BEGIN IA CHANGES |
match | public Cookie[] match(String host, int port, String path, boolean secure, SortedMap cookies)(Code) | | Return an array of
Cookie s that should be submitted with a
request with given attributes, false otherwise.
If the SortedMap comes from an HttpState and is not itself
thread-safe, it may be necessary to synchronize on the HttpState
instance to protect against concurrent modification.
Parameters: host - the host to which the request is being submitted Parameters: port - the port to which the request is being submitted (currentlyignored) Parameters: path - the path to which the request is being submitted Parameters: secure - true if the request is using a secure protocol Parameters: cookies - SortedMap of Cookies to be matched an array of Cookies matching the criterium |
parse | public Cookie[] parse(String host, int port, String path, boolean secure, String header) throws MalformedCookieException(Code) | | Parses the Set-Cookie value into an array of Cookies.
The syntax for the Set-Cookie response header is:
set-cookie = "Set-Cookie:" cookies
cookies = 1#cookie
cookie = NAME "=" VALUE * (";" cookie-av)
NAME = attr
VALUE = value
cookie-av = "Comment" "=" value
| "Domain" "=" value
| "Max-Age" "=" value
| "Path" "=" value
| "Secure"
| "Version" "=" 1*DIGIT
Parameters: host - the host from which the Set-Cookie value wasreceived Parameters: port - the port from which the Set-Cookie value wasreceived Parameters: path - the path from which the Set-Cookie value wasreceived Parameters: secure - true when the Set-Cookie value wasreceived over secure conection Parameters: header - the Set-Cookie received from the server an array of Cookies parsed from the Set-Cookie value throws: MalformedCookieException - if an exception occurs during parsing |
parse | public Cookie[] parse(String host, int port, String path, boolean secure, Header header) throws MalformedCookieException(Code) | | Parse the "Set-Cookie"
Header into an array of
Cookie s.
The syntax for the Set-Cookie response header is:
set-cookie = "Set-Cookie:" cookies
cookies = 1#cookie
cookie = NAME "=" VALUE * (";" cookie-av)
NAME = attr
VALUE = value
cookie-av = "Comment" "=" value
| "Domain" "=" value
| "Max-Age" "=" value
| "Path" "=" value
| "Secure"
| "Version" "=" 1*DIGIT
Parameters: host - the host from which the Set-Cookie header wasreceived Parameters: port - the port from which the Set-Cookie header wasreceived Parameters: path - the path from which the Set-Cookie header wasreceived Parameters: secure - true when the Set-Cookie header wasreceived over secure conection Parameters: header - the Set-Cookie received from the server an array of Cookies parsed from the "Set-Cookie" header throws: MalformedCookieException - if an exception occurs during parsing |
parseAttribute | public void parseAttribute(NameValuePair attribute, Cookie cookie) throws MalformedCookieException(Code) | | Parse the cookie attribute and update the corresponsing
Cookie properties.
Parameters: attribute - HeaderElement cookie attribute from theSet- Cookie Parameters: cookie - Cookie to be updated throws: MalformedCookieException - if an exception occurs during parsing |
pathMatch | public boolean pathMatch(String path, String topmostPath)(Code) | | Performs path-match as implemented in common browsers.
Parameters: path - The target path. Parameters: topmostPath - The cookie path attribute. true if the paths match |
setValidDateFormats | public void setValidDateFormats(Collection datepatterns)(Code) | | |
validate | public void validate(String host, int port, String path, boolean secure, Cookie cookie) throws MalformedCookieException(Code) | | Performs most common
Cookie validation
Parameters: host - the host from which the Cookie was received Parameters: port - the port from which the Cookie was received Parameters: path - the path from which the Cookie was received Parameters: secure - true when the Cookie was received using asecure connection Parameters: cookie - The cookie to validate. throws: MalformedCookieException - if an exception occurs duringvalidation |
|
|