org.exoplatform.services.rest
Class Cookie

java.lang.Object
  extended by org.exoplatform.services.rest.Cookie

public final class Cookie
extends Object

Version:
$Id: $
Author:
Andrey Parfonov

Constructor Summary
Cookie(String name, String value)
          Cookie with default version, and without specified path and domain.
Cookie(String name, String value, String path, String domain)
          Cookie with default version, default version is 0.
Cookie(String name, String value, String path, String domain, int version)
           
 
Method Summary
 String getComment()
           
 String getDomain()
           
 int getMaxAge()
          A positive value indicates that the cookie will expire after that many seconds have passed.
A negative value means that the cookie is not stored persistently and will be deleted when the Web browser exits.
 String getName()
           
 String getPath()
           
 String getValue()
           
 int getVersion()
          Cookie version.
 boolean isSecure()
          Check is this cookie marked as secure.
 void setComment(String comment)
           
 void setMaxAge(int maxAge)
           
 void setSecure(boolean secure)
           
 void setVersion(int version)
           
 String toString()
          String representation of cookie.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Cookie

public Cookie(String name,
              String value,
              String path,
              String domain,
              int version)
Parameters:
name - the coolie name.
value - the cookie value.
path - the URLs that see the cookie.
domain - the domain that sees cookie.
version - the cookie version, can be 0 or 1.

Cookie

public Cookie(String name,
              String value,
              String path,
              String domain)
Cookie with default version, default version is 0.

Parameters:
name - the coolie name.
value - the cookie value.
path - the URLs that see the cookie.
domain - the domain that sees cookie.

Cookie

public Cookie(String name,
              String value)
Cookie with default version, and without specified path and domain.

Parameters:
name - the coolie name.
value - the cookie value.
Method Detail

getName

public String getName()
Returns:
the cookie name.

getValue

public String getValue()
Returns:
the cookie value.

getMaxAge

public int getMaxAge()
A positive value indicates that the cookie will expire after that many seconds have passed.
A negative value means that the cookie is not stored persistently and will be deleted when the Web browser exits. A zero value causes the cookie to be deleted.

Returns:
the cookie max age.

setMaxAge

public void setMaxAge(int maxAge)
Parameters:
maxAge - the new cookie max age.
See Also:
getMaxAge()

getVersion

public int getVersion()
Cookie version. By default cookie version set to 0, this means it is Netscape version of cookie. Version 1 - RFC 2109.

Returns:
the cookie version.

setVersion

public void setVersion(int version)
Parameters:
version - the cookie version.
See Also:
getVersion()

getDomain

public String getDomain()
Returns:
the domain name for this cookie.

getPath

public String getPath()
Returns:
path for the cookie to which the client should return the cookie.

isSecure

public boolean isSecure()
Check is this cookie marked as secure. If it is then it must be send only using secure protocol, SSL or HTTPS ...

Returns:
the cookie secure state.

setSecure

public void setSecure(boolean secure)
Parameters:
secure - the new cookie secure state.
See Also:
isSecure()

getComment

public String getComment()
Returns:
the cookie comment.

setComment

public void setComment(String comment)
Parameters:
comment - the comment for this cookie.

toString

public String toString()
String representation of cookie.

Overrides:
toString in class Object
See Also:
{@inheritDoc}


Copyright © 2009 eXo Platform SAS. All Rights Reserved.