|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.meterware.httpunit.cookies.CookieJar
A collection of HTTP cookies, which can interact with cookie and set-cookie header values.
Constructor Summary | |
CookieJar()
Creates an empty cookie jar. |
|
CookieJar(CookieSource source)
Creates a cookie jar which is initially populated with cookies parsed from the Set-Cookie and
Set-Cookie2 header fields. |
Method Summary | |
void |
addCookie(java.lang.String name,
java.lang.String value)
Deprecated. as of 1.6, use #putCookie |
void |
clear()
Empties this cookie jar of all contents. |
Cookie |
getCookie(java.lang.String name)
Returns the value of the specified cookie. |
java.lang.String |
getCookieHeaderField(java.net.URL targetURL)
Returns the value of the cookie header to be sent to the specified URL. |
java.lang.String[] |
getCookieNames()
Returns the name of all the active cookies in this cookie jar. |
java.util.Collection |
getCookies()
Returns a collection containing all of the cookies in this jar. |
java.lang.String |
getCookieValue(java.lang.String name)
Returns the value of the specified cookie. |
void |
putCookie(java.lang.String name,
java.lang.String value)
Defines a cookie to be sent to the server on every request. |
void |
putSingleUseCookie(java.lang.String name,
java.lang.String value,
java.lang.String domain,
java.lang.String path)
Define a non-global cookie. |
void |
updateCookies(CookieJar newJar)
Updates the cookies maintained in this cookie jar with those in another cookie jar. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CookieJar()
public CookieJar(CookieSource source)
Set-Cookie
and
Set-Cookie2
header fields.
Note that the parsing does not strictly follow the specifications, but attempts to imitate the behavior of popular browsers. Specifically, it allows cookie values to contain commas, which the Netscape standard does not allow for, but which is required by some servers.
Method Detail |
public void clear()
public void addCookie(java.lang.String name, java.lang.String value)
public void putCookie(java.lang.String name, java.lang.String value)
public void putSingleUseCookie(java.lang.String name, java.lang.String value, java.lang.String domain, java.lang.String path)
public java.lang.String[] getCookieNames()
public java.util.Collection getCookies()
public java.lang.String getCookieValue(java.lang.String name)
name
- - the name of the cookie to get the value for
public Cookie getCookie(java.lang.String name)
public java.lang.String getCookieHeaderField(java.net.URL targetURL)
public void updateCookies(CookieJar newJar)
|
Copyright © 2000-2008 Russell Gold. See license agreement for rights granted. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |