public class SetCookie2Header extends AbstractSetCookieHeader
Set-Cookie2
request message header, defined in
RFC 2965. Note thatSet-Cookie2
is obsolete by RFC 6265. Although it may still work in some browsers, its use is discouraged.
Use Set-Cookie
instead.Modifier and Type | Field and Description |
---|---|
static String |
NAME
The name of this header.
|
Constructor and Description |
---|
SetCookie2Header(List<Cookie> cookies)
Constructs a new
Set-Cookie2 with the provided cookies. |
Modifier and Type | Method and Description |
---|---|
List<Cookie> |
getCookies()
Returns the unmodifiable list of cookies.
|
String |
getName()
Returns the name of the header, as it would canonically appear within an
HTTP message.
|
List<String> |
getValues()
Returns the header as a list of strings.
|
static SetCookie2Header |
valueOf(List<String> values)
Constructs a new header, initialized from the specified list of
Set-Cookie2 values. |
static SetCookie2Header |
valueOf(Response response)
Constructs a new header, initialized from the specified response message.
|
static SetCookie2Header |
valueOf(String value)
Constructs a new header, initialized from the specified string value.
|
equals, getFirstValue, hashCode, toString
public static final String NAME
public static SetCookie2Header valueOf(String value) throws MalformedHeaderException
value
- The value to initialize the header from.MalformedHeaderException
- If the header is malformed.public static SetCookie2Header valueOf(Response response) throws MalformedHeaderException
response
- The response message to initialize the header from.MalformedHeaderException
- If the header is malformed.public static SetCookie2Header valueOf(List<String> values) throws MalformedHeaderException
Set-Cookie2
values.
Note that the values could contain multiple cookies in a string.values
- The values to initialize the header from.MalformedHeaderException
- If the header is malformed.public String getName()
Header
public List<String> getValues()
Header
String
should represent the value component of the key-value
pair that makes up the HTTP header - as such, for some Header
implementations each String in this List
may contain multiple
token-separated values.
The List
returned from this method should not be expected to be
mutable. However, some subclasses of Header
may choose to
implement it as such.
public List<Cookie> getCookies()
getCookies
in class AbstractSetCookieHeader
Copyright © 2010-2018, ForgeRock All Rights Reserved.