HTTPClient
Class DefaultCookiePolicyHandler
java.lang.Object
HTTPClient.DefaultCookiePolicyHandler
- All Implemented Interfaces:
- CookiePolicyHandler
- class DefaultCookiePolicyHandler
- extends Object
- implements CookiePolicyHandler
A simple cookie policy handler.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultCookiePolicyHandler
DefaultCookiePolicyHandler()
acceptCookie
public boolean acceptCookie(Cookie cookie,
RoRequest req,
RoResponse resp)
- returns whether this cookie should be accepted. First checks the
stored lists of accept and reject domains, and if it is neither
accepted nor rejected by these then query the user via a popup.
- Specified by:
acceptCookie in interface CookiePolicyHandler
- Parameters:
cookie - the cookie in questionreq - the requestresp - the response
- Returns:
- true if we accept this cookie.
sendCookie
public boolean sendCookie(Cookie cookie,
RoRequest req)
- This handler just allows all cookies to be sent which were accepted
(i.e. no further restrictions are placed on the sending of cookies).
- Specified by:
sendCookie in interface CookiePolicyHandler
- Parameters:
cookie - the cookie in questionreq - the request this cookie is to be sent with
- Returns:
- true
addAcceptDomain
void addAcceptDomain(String domain)
addRejectDomain
void addRejectDomain(String domain)