Top Description Fields Constructors Methods
org.apache.http.impl.cookie

public Class NetscapeDraftSpec

extends CookieSpecBase
Class Inheritance
Annotations
@Obsolete
@Contract
threading:SAFE
Imports
java.util.ArrayList, .List, org.apache.http.FormattedHeader, .Header, .HeaderElement, org.apache.http.annotation.Contract, .Obsolete, .ThreadingBehavior, org.apache.http.cookie.CommonCookieAttributeHandler, .Cookie, .CookieOrigin, .MalformedCookieException, .SM, org.apache.http.message.BufferedHeader, .ParserCursor, org.apache.http.util.Args, .CharArrayBuffer

This org.apache.http.cookie.CookieSpec implementation conforms to the original draft specification published by Netscape Communications. It should be avoided unless absolutely necessary for compatibility with legacy applications.

Rendered obsolete by org.apache.http.impl.cookie.RFC6265LaxSpec.

Since
4.0
See Also
org.apache.http.impl.cookie.RFC6265LaxSpec

Field Summary

Modifier and TypeField and Description
protected static final String

Constructor Summary

AccessConstructor and Description
public
NetscapeDraftSpec(final String[] datepatterns)

Default constructor

pack-priv
public

Method Summary

Modifier and TypeMethod and Description
public List<Header>
formatCookies(final List<Cookie>
the Cookies format into a Cookie header
cookies
)

Implements org.apache.http.cookie.CookieSpec.formatCookies.

Create "Cookie" headers for an array of Cookies.
public int
getVersion()

Implements org.apache.http.cookie.CookieSpec.getVersion.

Returns version of the state management this cookie specification conforms to.
public Header
getVersionHeader()

Implements org.apache.http.cookie.CookieSpec.getVersionHeader.

Returns a request header identifying what version of the state management specification is understood.
public List<Cookie>

Returns:

an array of Cookies parsed from the Set-Cookie value
parse
(final Header
the Set-Cookie received from the server
header
,
final CookieOrigin
details of the cookie origin
origin
)

Implements org.apache.http.cookie.CookieSpec.parse.

Parses the Set-Cookie value into an array of Cookies.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from org.apache.http.impl.cookie.CookieSpecBase:
getDefaultDomaingetDefaultPathmatchparsevalidate

Field Detail

EXPIRES_PATTERNback to summary
protected static final String EXPIRES_PATTERN

Constructor Detail

NetscapeDraftSpecback to summary
public NetscapeDraftSpec(final String[] datepatterns)

Default constructor

NetscapeDraftSpecback to summary
pack-priv NetscapeDraftSpec(final CommonCookieAttributeHandler... handlers)
NetscapeDraftSpecback to summary
public NetscapeDraftSpec()

Method Detail

formatCookiesback to summary
public List<Header> formatCookies(final List<Cookie> cookies)

Implements org.apache.http.cookie.CookieSpec.formatCookies.

Doc from org.apache.http.cookie.CookieSpec.formatCookies.

Create "Cookie" headers for an array of Cookies.

Parameters
cookies:List<Cookie>

the Cookies format into a Cookie header

Returns:List<Header>

a Header for the given Cookies.

Annotations
@Override
getVersionback to summary
public int getVersion()

Implements org.apache.http.cookie.CookieSpec.getVersion.

Doc from org.apache.http.cookie.CookieSpec.getVersion.

Returns version of the state management this cookie specification conforms to.

Returns:int

version of the state management specification

Annotations
@Override
getVersionHeaderback to summary
public Header getVersionHeader()

Implements org.apache.http.cookie.CookieSpec.getVersionHeader.

Doc from org.apache.http.cookie.CookieSpec.getVersionHeader.

Returns a request header identifying what version of the state management specification is understood. May be null if the cookie specification does not support Cookie2 header.

Annotations
@Override
parseback to summary
public List<Cookie> parse(final Header header, final CookieOrigin origin) throws MalformedCookieException

Implements org.apache.http.cookie.CookieSpec.parse.

Parses the Set-Cookie value into an array of Cookies.

Syntax of the Set-Cookie HTTP Response Header:

This is the format a CGI script would use to add to the HTTP headers a new piece of data which is to be stored by the client for later retrieval.

 Set-Cookie: NAME=VALUE; expires=DATE; path=PATH; domain=DOMAIN_NAME; secure

Please note that the Netscape draft specification does not fully conform to the HTTP header format. Comma character if present in Set-Cookie will not be treated as a header element separator

Parameters
header:Header

the Set-Cookie received from the server

origin:CookieOrigin

Doc from org.apache.http.cookie.CookieSpec.parse.

details of the cookie origin

Returns:List<Cookie>

an array of Cookies parsed from the Set-Cookie value

Annotations
@Override
Exceptions
MalformedCookieException:
if an exception occurs during parsing
See Also
The Cookie Spec.
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override