| org.apache.commons.httpclient.cookie.CookieSpec
All known Subclasses: org.apache.commons.httpclient.cookie.IgnoreCookiesSpec, org.apache.commons.httpclient.cookie.CookieSpecBase,
CookieSpec | public interface CookieSpec (Code) | | Defines the cookie management specification.
Cookie management specification must define
- rules of parsing "Set-Cookie" header
- rules of validation of parsed cookies
- formatting of "Cookie" header
for a given host, port and path of origin
author: Oleg Kalnichevski author: Jeff Dever since: 2.0 |
Method Summary | |
boolean | domainMatch(String host, String domain) Performs domain-match as defined by the cookie specification.
Parameters: host - The target host. Parameters: domain - The cookie domain attribute. | String | formatCookie(Cookie cookie) Create a "Cookie" header value for an array of cookies. | Header | formatCookieHeader(Cookie[] cookies) Create a "Cookie" Header for an array of Cookies. | Header | formatCookieHeader(Cookie cookie) Create a "Cookie" Header for single Cookie. | String | formatCookies(Cookie[] cookies) Create a "Cookie" header value for an array of cookies. | Collection | getValidDateFormats() Returns the
Collection of date patterns used for parsing. | boolean | match(String host, int port, String path, boolean secure, Cookie cookie) Determines if a Cookie matches a location. | Cookie[] | match(String host, int port, String path, boolean secure, Cookie cookies) Determines which of an array of Cookies matches a location. | Cookie[] | match(String domain, int port, String path, boolean secure, SortedMap cookiesMap) Determines which of an array of Cookies matches a location.
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. | Cookie[] | parse(String host, int port, String path, boolean secure, String header) Parse the "Set-Cookie" header value into Cookie array. | Cookie[] | parse(String host, int port, String path, boolean secure, Header header) Parse the "Set-Cookie" Header into an array of Cookies. | void | parseAttribute(NameValuePair attribute, Cookie cookie) Parse the cookie attribute and update the corresponsing Cookie
properties. | boolean | pathMatch(String path, String topmostPath) Performs path-match as defined by the cookie specification.
Parameters: path - The target path. Parameters: topmostPath - The cookie path attribute. | void | setValidDateFormats(Collection datepatterns) Sets the
Collection of date patterns used for parsing. | void | validate(String host, int port, String path, boolean secure, Cookie cookie) Validate the cookie according to validation rules defined by the
cookie specification. |
PATH_DELIM | final static String PATH_DELIM(Code) | | Path delimiter
|
PATH_DELIM_CHAR | final static char PATH_DELIM_CHAR(Code) | | Path delimiting charachter
|
domainMatch | boolean domainMatch(String host, String domain)(Code) | | Performs domain-match as defined by the cookie specification.
Parameters: host - The target host. Parameters: domain - The cookie domain attribute. true if the specified host matches the given domain. since: 3.0 |
formatCookie | String formatCookie(Cookie cookie)(Code) | | Create a "Cookie" header value for an array of cookies.
Parameters: cookie - the cookie to be formatted as string a string suitable for sending in a "Cookie" header. |
formatCookieHeader | Header formatCookieHeader(Cookie[] cookies) throws IllegalArgumentException(Code) | | Create a "Cookie" Header for an array of Cookies.
Parameters: cookies - the Cookies format into a Cookie header a Header for the given Cookies. throws: IllegalArgumentException - if an input parameter is illegal |
match | boolean match(String host, int port, String path, boolean secure, Cookie cookie)(Code) | | Determines if a Cookie matches a location.
Parameters: host - the host to which the request is being submitted Parameters: port - the port to which the request is being submitted Parameters: path - the path to which the request is being submitted Parameters: secure - true if the request is using a secure connection Parameters: cookie - the Cookie to be matched true if the cookie should be submitted with a request with given attributes, false otherwise. |
match | Cookie[] match(String host, int port, String path, boolean secure, Cookie cookies)(Code) | | Determines which of an array of Cookies matches a location.
Parameters: host - the host to which the request is being submitted Parameters: port - the port to which the request is being submitted (currenlty ignored) 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 true if the cookie should be submitted with a request with given attributes, false otherwise.// BEGIN IA CHANGES |
match | Cookie[] match(String domain, int port, String path, boolean secure, SortedMap cookiesMap)(Code) | | Determines which of an array of Cookies matches a location.
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 (currenlty ignored) 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 true if the cookie should be submitted with a request with given attributes, false otherwise. |
parse | Cookie[] parse(String host, int port, String path, boolean secure, String header) throws MalformedCookieException, IllegalArgumentException(Code) | | Parse the "Set-Cookie" header value into Cookie array.
Parameters: host - the host which sent the Set-Cookie header Parameters: port - the port which sent the Set-Cookie header Parameters: path - the path which sent the Set-Cookie header Parameters: secure - true when the Set-Cookie header was received 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 throws: IllegalArgumentException - if an input parameter is illegal |
parse | Cookie[] parse(String host, int port, String path, boolean secure, Header header) throws MalformedCookieException, IllegalArgumentException(Code) | | Parse the "Set-Cookie" Header into an array of Cookies.
Parameters: host - the host which sent the Set-Cookie header Parameters: port - the port which sent the Set-Cookie header Parameters: path - the path which sent the Set-Cookie header Parameters: secure - true when the Set-Cookie header was received over secure conection Parameters: header - the Set-Cookie received from the server an array of Cookies parsed from the header throws: MalformedCookieException - if an exception occurs during parsing throws: IllegalArgumentException - if an input parameter is illegal |
parseAttribute | void parseAttribute(NameValuePair attribute, Cookie cookie) throws MalformedCookieException, IllegalArgumentException(Code) | | Parse the cookie attribute and update the corresponsing Cookie
properties.
Parameters: attribute - cookie attribute from the Set-Cookie Parameters: cookie - the to be updated throws: MalformedCookieException - if an exception occurs during parsing throws: IllegalArgumentException - if an input parameter is illegal |
pathMatch | boolean pathMatch(String path, String topmostPath)(Code) | | Performs path-match as defined by the cookie specification.
Parameters: path - The target path. Parameters: topmostPath - The cookie path attribute. true if the paths match since: 3.0 |
validate | void validate(String host, int port, String path, boolean secure, Cookie cookie) throws MalformedCookieException, IllegalArgumentException(Code) | | Validate the cookie according to validation rules defined by the
cookie specification.
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 a secure connection Parameters: cookie - the Cookie to validate throws: MalformedCookieException - if the cookie is invalid throws: IllegalArgumentException - if an input parameter is illegal |
|
|