Class DefaultCookie
java.lang.Object
org.jboss.netty.handler.codec.http.cookie.DefaultCookie
- All Implemented Interfaces:
Comparable<Cookie>
,Cookie
- Direct Known Subclasses:
DefaultCookie
The default
Cookie
implementation.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefaultCookie
(String name, String value) Creates a new cookie with the specified name and value. -
Method Summary
Modifier and TypeMethodDescriptionint
domain()
Returns the domain of thisCookie
.boolean
int
hashCode()
boolean
Checks to see if thisCookie
can only be accessed via HTTP.boolean
isSecure()
Checks to see if thisCookie
is secureint
maxAge()
Returns the maximum age of thisCookie
in seconds orInteger.MIN_VALUE
if unspecifiedname()
Returns the name of thisCookie
.path()
Returns the path of thisCookie
.void
Sets the domain of thisCookie
.void
setHttpOnly
(boolean httpOnly) Determines if thisCookie
is HTTP only.void
setMaxAge
(int maxAge) Sets the maximum age of thisCookie
in seconds.void
Sets the path of thisCookie
.void
setSecure
(boolean secure) Sets the security getStatus of thisCookie
void
Sets the value of thisCookie
.void
setWrap
(boolean wrap) Sets true if the value of thisCookie
is to be wrapped with double quotes.toString()
protected String
validateValue
(String name, String value) value()
Returns the value of thisCookie
.boolean
wrap()
Returns true if the raw value of thisCookie
, was wrapped with double quotes in original Set-Cookie header.
-
Field Details
-
name
-
value
-
wrap
private boolean wrap -
domain
-
path
-
maxAge
private int maxAge -
secure
private boolean secure -
httpOnly
private boolean httpOnly
-
-
Constructor Details
-
DefaultCookie
Creates a new cookie with the specified name and value.
-
-
Method Details
-
name
Description copied from interface:Cookie
Returns the name of thisCookie
. -
value
Description copied from interface:Cookie
Returns the value of thisCookie
. -
setValue
Description copied from interface:Cookie
Sets the value of thisCookie
. -
wrap
public boolean wrap()Description copied from interface:Cookie
Returns true if the raw value of thisCookie
, was wrapped with double quotes in original Set-Cookie header. -
setWrap
public void setWrap(boolean wrap) Description copied from interface:Cookie
Sets true if the value of thisCookie
is to be wrapped with double quotes. -
domain
Description copied from interface:Cookie
Returns the domain of thisCookie
. -
setDomain
Description copied from interface:Cookie
Sets the domain of thisCookie
. -
path
Description copied from interface:Cookie
Returns the path of thisCookie
. -
setPath
Description copied from interface:Cookie
Sets the path of thisCookie
. -
maxAge
public int maxAge()Description copied from interface:Cookie
Returns the maximum age of thisCookie
in seconds orInteger.MIN_VALUE
if unspecified -
setMaxAge
public void setMaxAge(int maxAge) Description copied from interface:Cookie
Sets the maximum age of thisCookie
in seconds. If an age of0
is specified, thisCookie
will be automatically removed by browser because it will expire immediately. IfInteger.MIN_VALUE
is specified, thisCookie
will be removed when the browser is closed. -
isSecure
public boolean isSecure()Description copied from interface:Cookie
Checks to see if thisCookie
is secure -
setSecure
public void setSecure(boolean secure) Description copied from interface:Cookie
Sets the security getStatus of thisCookie
-
isHttpOnly
public boolean isHttpOnly()Description copied from interface:Cookie
Checks to see if thisCookie
can only be accessed via HTTP. If this returns true, theCookie
cannot be accessed through client side script - But only if the browser supports it. For more information, please look here- Specified by:
isHttpOnly
in interfaceCookie
- Returns:
- True if this
Cookie
is HTTP-only or false if it isn't
-
setHttpOnly
public void setHttpOnly(boolean httpOnly) Description copied from interface:Cookie
Determines if thisCookie
is HTTP only. If set to true, thisCookie
cannot be accessed by a client side script. However, this works only if the browser supports it. For for information, please look here.- Specified by:
setHttpOnly
in interfaceCookie
- Parameters:
httpOnly
- True if theCookie
is HTTP only, otherwise false.
-
hashCode
public int hashCode() -
equals
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Cookie>
-
toString
-
validateValue
-