public class Cookie
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
discard |
protected java.net.URI |
domain |
protected java.util.Date |
expirationDate |
static java.util.HashSet<java.lang.Character> |
httpSeparatorCharacters
Taken from this discussion:
|
protected java.lang.String |
name |
protected java.net.URI |
path |
protected java.lang.String |
value |
protected int |
version |
Modifier | Constructor and Description |
---|---|
protected |
Cookie() |
|
Cookie(java.net.URI myPath,
java.lang.String myName,
java.lang.String myValue,
java.util.Date myExpirationDate)
Constructor for creating cookies which are to be used in
ToadletContext.setCookie . |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
encodeToHeaderValue()
Encodes the content of this cookie to the HTTP header value representation as of RFC2965.
|
boolean |
equals(java.lang.Object obj)
Returns true if two Cookies have equal domain, path and name.
|
java.net.URI |
getDomain() |
java.lang.String |
getName() |
java.net.URI |
getPath() |
java.lang.String |
getValue() |
int |
hashCode() |
static java.net.URI |
validateDomain(java.lang.String domainString) |
static java.net.URI |
validateDomain(java.net.URI domain) |
static java.util.Date |
validateExpirationDate(java.util.Date expirationDate) |
static java.lang.String |
validateName(java.lang.String name)
Validates the name of a cookie against a mixture of RFC2965, RFC2616 (from IETF.org) and personal choice :|
The personal choice is mostly that it uses isISOControl for determining control characters instead of the
list in the RFC - therefore, more characters are considered as control characters.
|
static java.net.URI |
validatePath(java.lang.String stringPath) |
static java.net.URI |
validatePath(java.net.URI path) |
static java.lang.String |
validateValue(java.lang.String value)
Validates the value of a cookie against a mixture of RFC2965, RFC2616 (from IETF.org) and personal choice :|
The personal choice is mostly that it uses isISOControl for determining control characters instead of the
list in the RFC - therefore, more characters are considered as control characters.
|
public static final java.util.HashSet<java.lang.Character> httpSeparatorCharacters
protected int version
protected java.net.URI domain
protected java.net.URI path
protected java.lang.String name
protected java.lang.String value
protected java.util.Date expirationDate
protected boolean discard
public Cookie(java.net.URI myPath, java.lang.String myName, java.lang.String myValue, java.util.Date myExpirationDate)
ToadletContext.setCookie
.myPath
- The path of the cookie. Must be absolute.myName
- The name of the cookie. Must be latin letters and numbers only and is converted to lowercase.myValue
- The value of the cookie. Must not contain any linebreaks. May be null, null means empty value.java.net.URISyntaxException
protected Cookie()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public static java.net.URI validateDomain(java.lang.String domainString) throws java.net.URISyntaxException
java.net.URISyntaxException
public static java.net.URI validateDomain(java.net.URI domain)
public static java.net.URI validatePath(java.lang.String stringPath) throws java.net.URISyntaxException
java.net.URISyntaxException
public static java.net.URI validatePath(java.net.URI path)
public static java.lang.String validateName(java.lang.String name)
public static java.lang.String validateValue(java.lang.String value)
public static java.util.Date validateExpirationDate(java.util.Date expirationDate)
public java.net.URI getDomain()
public java.net.URI getPath()
public java.lang.String getName()
public java.lang.String getValue()
protected java.lang.String encodeToHeaderValue()