public interface CookieSpec
Cookie management specification must define
Modifier and Type | Field and Description |
---|---|
static String |
PATH_DELIM
Path delimiter
|
static char |
PATH_DELIM_CHAR
Path delimiting charachter
|
Modifier and Type | Method and Description |
---|---|
boolean |
domainMatch(String host,
String domain)
Performs domain-match as defined by the cookie specification.
|
String |
formatCookie(Cookie cookie)
Create a "Cookie" header value for an array of cookies.
|
org.apache.commons.httpclient.Header |
formatCookieHeader(Cookie cookie)
Create a "Cookie" Header for single Cookie.
|
org.apache.commons.httpclient.Header |
formatCookieHeader(Cookie[] cookies)
Create a "Cookie" Header for an array of Cookies.
|
String |
formatCookies(Cookie[] cookies)
Create a "Cookie" header value for an array of cookies.
|
Collection<String> |
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)
Deprecated.
use match(String, int, String, boolean, SortedMap)
// END IA/HERITRIX CHANGES
|
Cookie[] |
match(String domain,
int port,
String path,
boolean secure,
SortedMap<String,Cookie> cookiesMap)
Determines which of an array of Cookies matches a location.
|
Cookie[] |
parse(String host,
int port,
String path,
boolean secure,
org.apache.commons.httpclient.Header header)
Parse the "Set-Cookie" Header into an array of Cookies.
|
Cookie[] |
parse(String host,
int port,
String path,
boolean secure,
String header)
Parse the "Set-Cookie" header value into Cookie array.
|
void |
parseAttribute(org.apache.commons.httpclient.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.
|
void |
setValidDateFormats(Collection<String> 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.
|
static final String PATH_DELIM
static final char PATH_DELIM_CHAR
Cookie[] parse(String host, int port, String path, boolean secure, String header) throws org.apache.commons.httpclient.cookie.MalformedCookieException, IllegalArgumentException
This method will not perform the validation of the resultant
Cookie
s
host
- the host which sent the Set-Cookie headerport
- the port which sent the Set-Cookie headerpath
- the path which sent the Set-Cookie headersecure
- true when the Set-Cookie header
was received over secure conectionheader
- the Set-Cookie received from the serverMalformedCookieException
- if an exception occurs during parsingIllegalArgumentException
- if an input parameter is illegalvalidate(String, int, String, boolean, Cookie)
Cookie[] parse(String host, int port, String path, boolean secure, org.apache.commons.httpclient.Header header) throws org.apache.commons.httpclient.cookie.MalformedCookieException, IllegalArgumentException
This method will not perform the validation of the resultant
Cookie
s
host
- the host which sent the Set-Cookie headerport
- the port which sent the Set-Cookie headerpath
- the path which sent the Set-Cookie headersecure
- true when the Set-Cookie header
was received over secure conectionheader
- the Set-Cookie received from the serverMalformedCookieException
- if an exception occurs during parsingIllegalArgumentException
- if an input parameter is illegalvalidate(String, int, String, boolean, Cookie)
void parseAttribute(org.apache.commons.httpclient.NameValuePair attribute, Cookie cookie) throws org.apache.commons.httpclient.cookie.MalformedCookieException, IllegalArgumentException
attribute
- cookie attribute from the Set-Cookiecookie
- the to be updatedMalformedCookieException
- if an exception occurs during parsingIllegalArgumentException
- if an input parameter is illegalvoid validate(String host, int port, String path, boolean secure, Cookie cookie) throws org.apache.commons.httpclient.cookie.MalformedCookieException, IllegalArgumentException
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 the cookie is invalidIllegalArgumentException
- if an input parameter is illegalvoid setValidDateFormats(Collection<String> datepatterns)
Collection
of date patterns used for parsing. The String patterns must be
compatible with SimpleDateFormat
.datepatterns
- collection of date patternsCollection<String> getValidDateFormats()
Collection
of date patterns used for parsing. The String patterns are compatible
with the SimpleDateFormat
.boolean match(String host, int port, String path, boolean secure, Cookie cookie)
host
- the host to which the request is being submittedport
- the port to which the request is being submittedpath
- the path to which the request is being submittedsecure
- true if the request is using a secure connectioncookie
- the Cookie to be matchedCookie[] match(String host, int port, String path, boolean secure, Cookie[] cookies)
host
- the host to which the request is being submittedport
- the port to which the request is being submitted
(currenlty ignored)path
- the path to which the request is being submittedsecure
- true if the request is using a secure protocolcookies
- an array of Cookies to be matchedCookie[] match(String domain, int port, String path, boolean secure, SortedMap<String,Cookie> cookiesMap)
host
- the host to which the request is being submittedport
- the port to which the request is being submitted
(currently ignored)path
- the path to which the request is being submittedsecure
- true if the request is using a secure protocolcookies
- SortedMap of Cookies to be matchedboolean domainMatch(String host, String domain)
host
- The target host.domain
- The cookie domain attribute.boolean pathMatch(String path, String topmostPath)
path
- The target path.topmostPath
- The cookie path attribute.String formatCookie(Cookie cookie)
cookie
- the cookie to be formatted as stringString formatCookies(Cookie[] cookies) throws IllegalArgumentException
cookies
- the Cookies to be formattedIllegalArgumentException
- if an input parameter is illegalorg.apache.commons.httpclient.Header formatCookieHeader(Cookie[] cookies) throws IllegalArgumentException
cookies
- the Cookies format into a Cookie headerIllegalArgumentException
- if an input parameter is illegalorg.apache.commons.httpclient.Header formatCookieHeader(Cookie cookie) throws IllegalArgumentException
cookie
- the Cookie format as a Cookie headerIllegalArgumentException
- if an input parameter is illegalCopyright © 2003-2014 Internet Archive. All Rights Reserved.