| java.lang.Object com.meterware.httpunit.cookies.CookieJar
CookieJar | public class CookieJar (Code) | | A collection of HTTP cookies, which can interact with cookie and set-cookie header values.
author: Russell Gold author: Drew Varner |
Inner Class :abstract class CookieRecipe | |
Inner Class :class CookiePress | |
Inner Class :class RFC2109CookieRecipe extends CookieRecipe | |
Inner Class :class RFC2965CookieRecipe extends CookieRecipe | |
Constructor Summary | |
public | CookieJar() Creates an empty cookie jar. | public | CookieJar(CookieSource source) Creates a cookie jar which is initially populated with cookies parsed from the 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. |
CookieJar | public CookieJar()(Code) | | Creates an empty cookie jar.
|
CookieJar | public CookieJar(CookieSource source)(Code) | | Creates a cookie jar which is initially populated with cookies parsed from the 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.
|
addCookie | public void addCookie(String name, String value)(Code) | | Defines a cookie to be sent to the server on every request. This bypasses the normal mechanism by which only
certain cookies are sent based on their host and path.
|
addUniqueCookie | void addUniqueCookie(Cookie cookie)(Code) | | Add the cookie to this jar, replacing any previous matching cookie.
|
clear | public void clear()(Code) | | Empties this cookie jar of all contents.
|
getCookie | public Cookie getCookie(String name)(Code) | | Returns the value of the specified cookie.
|
getCookieHeaderField | public String getCookieHeaderField(URL targetURL)(Code) | | Returns the value of the cookie header to be sent to the specified URL.
Will return null if no compatible cookie is defined.
|
getCookieNames | public String[] getCookieNames()(Code) | | Returns the name of all the active cookies in this cookie jar.
|
getCookieValue | public String getCookieValue(String name)(Code) | | Returns the value of the specified cookie.
|
getCookies | public Collection getCookies()(Code) | | Returns a collection containing all of the cookies in this jar.
|
putCookie | public void putCookie(String name, String value)(Code) | | Defines a cookie to be sent to the server on every request. This bypasses the normal mechanism by which only
certain cookies are sent based on their host and path.
since: 1.6 |
updateCookies | public void updateCookies(CookieJar newJar)(Code) | | Updates the cookies maintained in this cookie jar with those in another cookie jar. Any duplicate cookies in
the new jar will replace those in this jar.
|
|
|