This class provides an interface to the netscape cookies file to pass cookies
along with a request.
Now uses Commons HttpClient parsing and matching code (since 2.1.2)
add
public void add(Cookie c)
Add a cookie.
addCookieFromHeader
public void addCookieFromHeader(String cookieHeader,
URL url)
addFile
public void addFile(String cookieFile)
throws IOException
Add cookie data from a file.
get
public Cookie get(int i)
Return the cookie at index i.
getClearEachIteration
public boolean getClearEachIteration()
getCookieCount
public int getCookieCount()
getCookieHeaderForURL
public String getCookieHeaderForURL(URL url)
Find cookies applicable to the given URL and build the Cookie header from
them.
url
- URL of the request to which the returned header will be added.
- the value string for the cookie header (goes after "Cookie: ").
getCookiesForUrl
public org.apache.commons.httpclient.Cookie[] getCookiesForUrl(URL url)
Get array of valid HttpClient cookies for the URL
- array of HttpClient cookies
getPolicy
public String getPolicy()
remove
public void remove(int index)
Remove a cookie.
save
public void save(String authFile)
throws IOException
Save the static cookie data to a file.
Cookies are only taken from the GUI - runtime cookies are not included.
setClearEachIteration
public void setClearEachIteration(boolean clear)
setCookiePolicy
public void setCookiePolicy(String policy)