HTTPClient
Class DefaultCookiePolicyHandler

java.lang.Object
  extended byHTTPClient.DefaultCookiePolicyHandler
All Implemented Interfaces:
CookiePolicyHandler

class DefaultCookiePolicyHandler
extends Object
implements CookiePolicyHandler

A simple cookie policy handler.


Constructor Summary
(package private) DefaultCookiePolicyHandler()
           
 
Method Summary
 boolean acceptCookie(Cookie cookie, RoRequest req, RoResponse resp)
          returns whether this cookie should be accepted.
(package private)  void addAcceptDomain(String domain)
           
(package private)  void addRejectDomain(String domain)
           
 boolean sendCookie(Cookie cookie, RoRequest req)
          This handler just allows all cookies to be sent which were accepted (i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCookiePolicyHandler

DefaultCookiePolicyHandler()
Method Detail

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 question
req - the request
resp - 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 question
req - the request this cookie is to be sent with
Returns:
true

addAcceptDomain

void addAcceptDomain(String domain)

addRejectDomain

void addRejectDomain(String domain)