Package java.net
Interface CookiePolicy
-
public interface CookiePolicyCookiePolicy has three pre-defined policy. They are ACCEPT_ALL, ACCEPT_NONE and ACCEPT_ORIGINAL_SERVER respectively. They are used to decide which cookies should be accepted and which should not be. See RFC 2965 sections 3.3 and 7 for more detail.- Since:
- 1.6
-
-
Field Summary
Fields Modifier and Type Field Description static CookiePolicyACCEPT_ALLA pre-defined policy, accepts all cookies.static CookiePolicyACCEPT_NONEA pre-defined policy, accepts no cookies at all.static CookiePolicyACCEPT_ORIGINAL_SERVERA pre-defined policy, only accepts cookies from original server.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanshouldAccept(URI uri, HttpCookie cookie)This method is used to determine whether or not the specified cookie should be accepted.
-
-
-
Field Detail
-
ACCEPT_ALL
static final CookiePolicy ACCEPT_ALL
A pre-defined policy, accepts all cookies.
-
ACCEPT_NONE
static final CookiePolicy ACCEPT_NONE
A pre-defined policy, accepts no cookies at all.
-
ACCEPT_ORIGINAL_SERVER
static final CookiePolicy ACCEPT_ORIGINAL_SERVER
A pre-defined policy, only accepts cookies from original server.
-
-
Method Detail
-
shouldAccept
boolean shouldAccept(URI uri, HttpCookie cookie)
This method is used to determine whether or not the specified cookie should be accepted.- Parameters:
uri- the URI to used to determine acceptabilitycookie- the HttpCookie to be determined- Returns:
- true if this cookie should be accepted; false otherwise
-
-