Class DefaultCookie
- java.lang.Object
-
- org.jboss.netty.handler.codec.http.cookie.DefaultCookie
-
- Direct Known Subclasses:
DefaultCookie
public class DefaultCookie extends java.lang.Object implements Cookie
The defaultCookieimplementation.
-
-
Constructor Summary
Constructors Constructor Description DefaultCookie(java.lang.String name, java.lang.String value)Creates a new cookie with the specified name and value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Cookie c)java.lang.Stringdomain()Returns the domain of thisCookie.booleanequals(java.lang.Object o)inthashCode()booleanisHttpOnly()Checks to see if thisCookiecan only be accessed via HTTP.booleanisSecure()Checks to see if thisCookieis secureintmaxAge()Returns the maximum age of thisCookiein seconds orInteger.MIN_VALUEif unspecifiedjava.lang.Stringname()Returns the name of thisCookie.java.lang.Stringpath()Returns the path of thisCookie.voidsetDomain(java.lang.String domain)Sets the domain of thisCookie.voidsetHttpOnly(boolean httpOnly)Determines if thisCookieis HTTP only.voidsetMaxAge(int maxAge)Sets the maximum age of thisCookiein seconds.voidsetPath(java.lang.String path)Sets the path of thisCookie.voidsetSecure(boolean secure)Sets the security getStatus of thisCookievoidsetValue(java.lang.String value)Sets the value of thisCookie.voidsetWrap(boolean wrap)Sets true if the value of thisCookieis to be wrapped with double quotes.java.lang.StringtoString()protected java.lang.StringvalidateValue(java.lang.String name, java.lang.String value)java.lang.Stringvalue()Returns the value of thisCookie.booleanwrap()Returns true if the raw value of thisCookie, was wrapped with double quotes in original Set-Cookie header.
-
-
-
Method Detail
-
name
public java.lang.String name()
Description copied from interface:CookieReturns the name of thisCookie.
-
value
public java.lang.String value()
Description copied from interface:CookieReturns the value of thisCookie.
-
setValue
public void setValue(java.lang.String value)
Description copied from interface:CookieSets the value of thisCookie.
-
wrap
public boolean wrap()
Description copied from interface:CookieReturns 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:CookieSets true if the value of thisCookieis to be wrapped with double quotes.
-
domain
public java.lang.String domain()
Description copied from interface:CookieReturns the domain of thisCookie.
-
setDomain
public void setDomain(java.lang.String domain)
Description copied from interface:CookieSets the domain of thisCookie.
-
path
public java.lang.String path()
Description copied from interface:CookieReturns the path of thisCookie.
-
setPath
public void setPath(java.lang.String path)
Description copied from interface:CookieSets the path of thisCookie.
-
maxAge
public int maxAge()
Description copied from interface:CookieReturns the maximum age of thisCookiein seconds orInteger.MIN_VALUEif unspecified
-
setMaxAge
public void setMaxAge(int maxAge)
Description copied from interface:Cookie
-
isSecure
public boolean isSecure()
Description copied from interface:CookieChecks to see if thisCookieis secure
-
setSecure
public void setSecure(boolean secure)
Description copied from interface:CookieSets the security getStatus of thisCookie
-
isHttpOnly
public boolean isHttpOnly()
Description copied from interface:CookieChecks to see if thisCookiecan only be accessed via HTTP. If this returns true, theCookiecannot be accessed through client side script - But only if the browser supports it. For more information, please look here- Specified by:
isHttpOnlyin interfaceCookie- Returns:
- True if this
Cookieis HTTP-only or false if it isn't
-
setHttpOnly
public void setHttpOnly(boolean httpOnly)
Description copied from interface:CookieDetermines if thisCookieis HTTP only. If set to true, thisCookiecannot be accessed by a client side script. However, this works only if the browser supports it. For for information, please look here.- Specified by:
setHttpOnlyin interfaceCookie- Parameters:
httpOnly- True if theCookieis HTTP only, otherwise false.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
compareTo
public int compareTo(Cookie c)
- Specified by:
compareToin interfacejava.lang.Comparable<Cookie>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
validateValue
protected java.lang.String validateValue(java.lang.String name, java.lang.String value)
-
-