Top Description Constructors Methods
org.apache.hc.client5.http.impl.cookie

public abstract Class CookieSpecBase

extends AbstractCookieSpec
Class Inheritance
Known Direct Subclasses
org.apache.hc.client5.http.impl.cookie.IgnoreSpecSpec
Annotations
@Contract
threading:SAFE
Imports
java.util.ArrayList, .HashMap, .List, .Locale, org.apache.hc.client5.http.cookie.CommonCookieAttributeHandler, .Cookie, .CookieAttributeHandler, .CookieOrigin, .MalformedCookieException, org.apache.hc.core5.annotation.Contract, .ThreadingBehavior, org.apache.hc.core5.http.HeaderElement, .NameValuePair, org.apache.hc.core5.util.Args

Cookie management functions shared by all specification.
Since
4.0

Constructor Summary

AccessConstructor and Description
public
protected
protected

Method Summary

Modifier and TypeMethod and Description
protected static String
protected static String
public boolean
match(final Cookie
the Cookie to be matched
cookie
,
final CookieOrigin
the target to test against
origin
)

Implements org.apache.hc.client5.http.cookie.CookieSpec.match.

Determines if a Cookie matches the target location.
protected List<Cookie>
parse(final HeaderElement[] elems, final CookieOrigin origin)

public void
validate(final Cookie
the Cookie to validate
cookie
,
final CookieOrigin
details of the cookie origin
origin
)

Implements org.apache.hc.client5.http.cookie.CookieSpec.validate.

Validate the cookie according to validation rules defined by the cookie specification.
Inherited from org.apache.hc.client5.http.impl.cookie.AbstractCookieSpec:
findAttribHandlergetAttribHandlergetAttribHandlers

Constructor Detail

CookieSpecBaseback to summary
public CookieSpecBase()
CookieSpecBaseback to summary
protected CookieSpecBase(final HashMap<String, CookieAttributeHandler> map)
Since
4.4
CookieSpecBaseback to summary
protected CookieSpecBase(final CommonCookieAttributeHandler... handlers)
Since
4.4

Method Detail

getDefaultDomainback to summary
protected static String getDefaultDomain(final CookieOrigin origin)
getDefaultPathback to summary
protected static String getDefaultPath(final CookieOrigin origin)
matchback to summary
public boolean match(final Cookie cookie, final CookieOrigin origin)

Implements org.apache.hc.client5.http.cookie.CookieSpec.match.

Doc from org.apache.hc.client5.http.cookie.CookieSpec.match.

Determines if a Cookie matches the target location.

Parameters
cookie:Cookie

the Cookie to be matched

origin:CookieOrigin

the target to test against

Returns:boolean

true if the cookie should be submitted with a request with given attributes, false otherwise.

Annotations
@Override
parseback to summary
protected List<Cookie> parse(final HeaderElement[] elems, final CookieOrigin origin) throws MalformedCookieException
validateback to summary
public void validate(final Cookie cookie, final CookieOrigin origin) throws MalformedCookieException

Implements org.apache.hc.client5.http.cookie.CookieSpec.validate.

Doc from org.apache.hc.client5.http.cookie.CookieSpec.validate.

Validate the cookie according to validation rules defined by the cookie specification.

Parameters
cookie:Cookie

the Cookie to validate

origin:CookieOrigin

details of the cookie origin

Annotations
@Override
Exceptions
MalformedCookieException:
if the cookie is invalid