|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.commons.httpclient.cookie.CookieSpecBase
Cookie management functions shared by all specification.
Field Summary | |
protected static Log |
LOG
Log object |
Fields inherited from interface org.apache.commons.httpclient.cookie.CookieSpec |
PATH_DELIM,
PATH_DELIM_CHAR |
Constructor Summary | |
CookieSpecBase()
Default constructor |
Method Summary | |
java.lang.String |
formatCookie(Cookie cookie)
Return a string suitable for sending in a "Cookie" header |
Header |
formatCookieHeader(Cookie cookie)
Create a "Cookie" Header containing the Cookie . |
Header |
formatCookieHeader(Cookie[] cookies)
Create a "Cookie" Header containing all Cookie s
in cookies. |
java.lang.String |
formatCookies(Cookie[] cookies)
Create a "Cookie" header value containing all Cookie s in
cookies suitable for sending in a "Cookie" header |
boolean |
match(java.lang.String host,
int port,
java.lang.String path,
boolean secure,
Cookie cookie)
Return true if the cookie should be submitted with a request with given attributes, false otherwise. |
Cookie[] |
match(java.lang.String host,
int port,
java.lang.String path,
boolean secure,
Cookie[] cookies)
Return an array of Cookie s that should be submitted with a
request with given attributes, false otherwise. |
Cookie[] |
parse(java.lang.String host,
int port,
java.lang.String path,
boolean secure,
Header header)
Parse the "Set-Cookie" Header into an array of Cookie s. |
Cookie[] |
parse(java.lang.String host,
int port,
java.lang.String path,
boolean secure,
java.lang.String header)
Parses the Set-Cookie value into an array of Cookies. |
void |
parseAttribute(NameValuePair attribute,
Cookie cookie)
Parse the 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 most common Cookie validation |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected static final Log LOG
Constructor Detail |
public CookieSpecBase()
Method Detail |
public Cookie[] parse(java.lang.String host, int port, java.lang.String path, boolean secure, java.lang.String header) throws MalformedCookieException
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
host
- the host from which the Set-Cookie value was
receivedport
- the port from which the Set-Cookie value was
receivedpath
- the path from which the Set-Cookie value was
receivedsecure
- true when the Set-Cookie value was
received over secure conectionheader
- the Set-Cookie received from the serverpublic Cookie[] parse(java.lang.String host, int port, java.lang.String path, boolean secure, Header header) throws MalformedCookieException
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
host
- the host from which the Set-Cookie header was
receivedport
- the port from which the Set-Cookie header was
receivedpath
- the path from which the Set-Cookie header was
receivedsecure
- true when the Set-Cookie header was
received over secure conectionheader
- the Set-Cookie received from the serverpublic void parseAttribute(NameValuePair attribute, Cookie cookie) throws MalformedCookieException
Cookie
properties.attribute
- HeaderElement
cookie attribute from the
Set- Cookiecookie
- Cookie
to be updatedpublic void validate(java.lang.String host, int port, java.lang.String path, boolean secure, Cookie cookie) throws MalformedCookieException
Cookie
validationhost
- 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 validate.public boolean match(java.lang.String host, int port, java.lang.String path, boolean secure, Cookie cookie)
host
- the host to which the request is being submittedport
- the port to which the request is being submitted (ignored)path
- the path to which the request is being submittedsecure
- true if the request is using a secure connectioncookie
- Cookie
to be matchedpublic Cookie[] match(java.lang.String host, int port, java.lang.String path, boolean secure, Cookie[] cookies)
Cookie
s that should be submitted with a
request with given attributes, false otherwise.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
- an array of Cookies to be matchedpublic java.lang.String formatCookie(Cookie cookie)
cookie
- a Cookie
to be formatted as stringpublic java.lang.String formatCookies(Cookie[] cookies) throws java.lang.IllegalArgumentException
Cookie
s in
cookies suitable for sending in a "Cookie" headercookies
- an array of Cookie
s to be formattedpublic Header formatCookieHeader(Cookie[] cookies)
Header
containing all Cookie
s
in cookies.cookies
- an array of Cookie
s to be formatted as a "
Cookie" headerHeader
.public Header formatCookieHeader(Cookie cookie)
Header
containing the Cookie
.cookie
- Cookies to be formatted as a Cookie
header
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |