Class NetscapeDraftSpec
- java.lang.Object
-
- org.apache.commons.httpclient.cookie.CookieSpecBase
-
- org.apache.commons.httpclient.cookie.NetscapeDraftSpec
-
- All Implemented Interfaces:
CookieSpec
@Deprecated public class NetscapeDraftSpec extends CookieSpecBase
Deprecated.Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project. It is not recommended to use it in any new code. Instead, use HTTP client API plugins as a dependency in your code. E.g. Apache HttpComponents Client API 4.x Plugin or Async HTTP Client Plugin.Netscape cookie draft specific cookie management functions
- Since:
- 2.0
-
-
Field Summary
-
Fields inherited from interface org.apache.commons.httpclient.cookie.CookieSpec
PATH_DELIM, PATH_DELIM_CHAR
-
-
Constructor Summary
Constructors Constructor Description NetscapeDraftSpec()
Deprecated.Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
domainMatch(java.lang.String host, java.lang.String domain)
Deprecated.Performs domain-match as described in the Netscape draft.Cookie[]
parse(java.lang.String host, int port, java.lang.String path, boolean secure, java.lang.String header)
Deprecated.Parses the Set-Cookie value into an array of Cookies.void
parseAttribute(NameValuePair attribute, Cookie cookie)
Deprecated.Parse the cookie attribute and update the corresponsingCookie
properties as defined by the Netscape draft specificationvoid
validate(java.lang.String host, int port, java.lang.String path, boolean secure, Cookie cookie)
Deprecated.Performs Netscape draft compliantCookie
validation-
Methods inherited from class org.apache.commons.httpclient.cookie.CookieSpecBase
formatCookie, formatCookieHeader, formatCookieHeader, formatCookies, getValidDateFormats, match, match, parse, pathMatch, setValidDateFormats
-
-
-
-
Method Detail
-
parse
public Cookie[] parse(java.lang.String host, int port, java.lang.String path, boolean secure, java.lang.String header) throws MalformedCookieException
Deprecated.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 Netscape draft specification does not fully conform to the HTTP header format. Netscape draft does not specify whether multiple cookies may be sent in one header. Hence, comma character may be present in unquoted cookie value or unquoted parameter value.
- Specified by:
parse
in interfaceCookieSpec
- Overrides:
parse
in classCookieSpecBase
- Parameters:
host
- the host from which the Set-Cookie value was receivedport
- the port from which the Set-Cookie value was receivedpath
- the path from which the Set-Cookie value was receivedsecure
- true when the Set-Cookie value was received over secure conectionheader
- the Set-Cookie received from the server- Returns:
- an array of Cookies parsed from the Set-Cookie value
- Throws:
MalformedCookieException
- if an exception occurs during parsing- See Also:
CookieSpec.validate(String, int, String, boolean, Cookie)
-
parseAttribute
public void parseAttribute(NameValuePair attribute, Cookie cookie) throws MalformedCookieException
Deprecated.Parse the cookie attribute and update the corresponsingCookie
properties as defined by the Netscape draft specification- Specified by:
parseAttribute
in interfaceCookieSpec
- Overrides:
parseAttribute
in classCookieSpecBase
- Parameters:
attribute
-NameValuePair
cookie attribute from the Set- Cookiecookie
-Cookie
to be updated- Throws:
MalformedCookieException
- if an exception occurs during parsing
-
domainMatch
public boolean domainMatch(java.lang.String host, java.lang.String domain)
Deprecated.Performs domain-match as described in the Netscape draft.- Specified by:
domainMatch
in interfaceCookieSpec
- Overrides:
domainMatch
in classCookieSpecBase
- Parameters:
host
- The target host.domain
- The cookie domain attribute.- Returns:
- true if the specified host matches the given domain.
-
validate
public void validate(java.lang.String host, int port, java.lang.String path, boolean secure, Cookie cookie) throws MalformedCookieException
Deprecated.Performs Netscape draft compliantCookie
validation- Specified by:
validate
in interfaceCookieSpec
- Overrides:
validate
in classCookieSpecBase
- Parameters:
host
- the host from which theCookie
was receivedport
- the port from which theCookie
was receivedpath
- the path from which theCookie
was receivedsecure
- true when theCookie
was received using a secure connectioncookie
- The cookie to validate.- Throws:
MalformedCookieException
- if an exception occurs during validation
-
-