org.apache.commons.httpclient.cookie
public abstract class CookiePolicy extends Object
RFC 2109 specification is used per default. Other supported specification can be chosen when appropriate or set default when desired
The following specifications are provided:
Since: 2.0
Field Summary | |
---|---|
static String | BROWSER_COMPATIBILITY
The policy that provides high degree of compatibilty
with common cookie management of popular HTTP agents.
|
static int | COMPATIBILITY
The COMPATIBILITY policy provides high compatibilty
with common cookie management of popular HTTP agents.
|
static String | DEFAULT
The default cookie policy.
|
static String | IGNORE_COOKIES
The policy that ignores cookies.
|
protected static Log | LOG Log object. |
static String | NETSCAPE
The Netscape cookie draft compliant policy.
|
static int | NETSCAPE_DRAFT
The NETSCAPE_DRAFT Netscape draft compliant policy.
|
static int | RFC2109
The RFC2109 RFC 2109 compliant policy.
|
static String | RFC_2109
The RFC 2109 compliant policy.
|
Method Summary | |
---|---|
static CookieSpec | getCompatibilitySpec() |
static CookieSpec | getCookieSpec(String id)
Gets the {@link CookieSpec cookie specification} with the given ID.
|
static int | getDefaultPolicy() |
static CookieSpec | getDefaultSpec()
Returns {@link CookieSpec cookie specification} registered as {@link #DEFAULT}.
|
static CookieSpec | getSpecByPolicy(int policy) |
static CookieSpec | getSpecByVersion(int ver)
Gets the CookieSpec for a particular cookie version.
|
static void | registerCookieSpec(String id, Class clazz)
Registers a new {@link CookieSpec cookie specification} with the given identifier.
|
static void | setDefaultPolicy(int policy) |
static void | unregisterCookieSpec(String id)
Unregisters the {@link CookieSpec cookie specification} with the given ID.
|
Since: 3.0
Deprecated: Use {@link #BROWSER_COMPATIBILITY}
The COMPATIBILITY policy provides high compatibilty with common cookie management of popular HTTP agents.Since: 3.0
Since: 3.0
Since: 3.0
Deprecated: Use {@link #NETSCAPE}
The NETSCAPE_DRAFT Netscape draft compliant policy.Deprecated: Use {@link #RFC_2109}
The RFC2109 RFC 2109 compliant policy.Since: 3.0
Deprecated: Use {@link CookiePolicy#getCookieSpec(String)}
Returns: cookie specification interface that provides high compatibilty with common cookie management of popular HTTP agents
Parameters: id the {@link CookieSpec cookie specification} ID
Returns: {@link CookieSpec cookie specification}
Throws: IllegalStateException if a policy with the ID cannot be found
Since: 3.0
Returns: default {@link CookieSpec cookie specification}
See Also: DEFAULT
Deprecated: Use {@link CookiePolicy#getCookieSpec(String)}
Parameters: policy cookie policy to get the CookieSpec for
Returns: cookie specification interface for the given policy
Deprecated: Use {@link CookiePolicy#getCookieSpec(String)}
Gets the CookieSpec for a particular cookie version.Supported versions:
Parameters: ver the cookie version to get the spec for
Returns: cookie specification interface intended for processing cookies with the given version
Parameters: id the identifier for this specification clazz the {@link CookieSpec cookie specification} class to register
Since: 3.0
Deprecated: Use {@link CookiePolicy#registerCookieSpec(String, Class)}
Parameters: policy new default cookie policy
See Also: DEFAULT
Parameters: id the ID of the {@link CookieSpec cookie specification} to unregister
Since: 3.0