net.wotonomy.web
Class WOCookie

java.lang.Object
  extended by javax.servlet.http.Cookie
      extended by net.wotonomy.web.WOCookie
All Implemented Interfaces:
java.lang.Cloneable

public class WOCookie
extends javax.servlet.http.Cookie

A pure java implementation of WOCookie that extends javax.servlet.httpd.Cookie for greater compatibility.

Version:
$Revision: 905 $
Author:
michael@mpowers.net, $Author: cgruber $

Constructor Summary
WOCookie()
          Default constructor.
WOCookie(java.lang.String aName, java.lang.String aValue)
          Constructs a cookie with the specified name and value.
 
Method Summary
static WOCookie cookieWithName(java.lang.String aName, java.lang.String aValue)
          Constructs a cookie with the specified name and value.
static WOCookie cookieWithName(java.lang.String aName, java.lang.String aValue, java.lang.String aPath, java.lang.String aDomain, net.wotonomy.foundation.NSDate expirationDate, boolean secure)
          Constructs a cookie with the specified attributes.
 java.lang.String domain()
          Gets the domain of the cookie.
 net.wotonomy.foundation.NSDate expires()
          Gets the expiration date of the cookie.
 java.lang.String headerString()
          Returns the string as it appears in the HTTP header of the response.
 boolean isSecure()
          Returns whether the cookie will only be sent over a secure protocol.
 java.lang.String name()
          Returns the name of the cookie.
 java.lang.String path()
          Gets the path of the cookie.
 void setDomain(java.lang.String aString)
          Sets the domain of the cookie.
 void setExpires(net.wotonomy.foundation.NSDate aDate)
          Sets the expiration date of the cookie.
 void setIsSecure(boolean isSecure)
          Sets whether the cookie will only be sent over a secure protocol.
 void setName(java.lang.String aString)
          Sets the name of the cookie.
 void setPath(java.lang.String aString)
          Sets the path of the cookie.
 void setValue(java.lang.String aString)
          Sets the value of the cookie.
 java.lang.String value()
          Returns the value of the cookie.
 
Methods inherited from class javax.servlet.http.Cookie
clone, getComment, getDomain, getMaxAge, getName, getPath, getSecure, getValue, getVersion, setComment, setMaxAge, setSecure, setVersion
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WOCookie

public WOCookie()
Default constructor.


WOCookie

public WOCookie(java.lang.String aName,
                java.lang.String aValue)
Constructs a cookie with the specified name and value.

Method Detail

cookieWithName

public static WOCookie cookieWithName(java.lang.String aName,
                                      java.lang.String aValue)
Constructs a cookie with the specified name and value. Also sets the path to the current application's path.


cookieWithName

public static WOCookie cookieWithName(java.lang.String aName,
                                      java.lang.String aValue,
                                      java.lang.String aPath,
                                      java.lang.String aDomain,
                                      net.wotonomy.foundation.NSDate expirationDate,
                                      boolean secure)
Constructs a cookie with the specified attributes.


name

public java.lang.String name()
Returns the name of the cookie.


setName

public void setName(java.lang.String aString)
Sets the name of the cookie.


value

public java.lang.String value()
Returns the value of the cookie.


setValue

public void setValue(java.lang.String aString)
Sets the value of the cookie.

Overrides:
setValue in class javax.servlet.http.Cookie

domain

public java.lang.String domain()
Gets the domain of the cookie.


setDomain

public void setDomain(java.lang.String aString)
Sets the domain of the cookie.

Overrides:
setDomain in class javax.servlet.http.Cookie

path

public java.lang.String path()
Gets the path of the cookie.


setPath

public void setPath(java.lang.String aString)
Sets the path of the cookie.

Overrides:
setPath in class javax.servlet.http.Cookie

expires

public net.wotonomy.foundation.NSDate expires()
Gets the expiration date of the cookie. If in the past, the cookie will persist until browser shutdown.


setExpires

public void setExpires(net.wotonomy.foundation.NSDate aDate)
Sets the expiration date of the cookie.


isSecure

public boolean isSecure()
Returns whether the cookie will only be sent over a secure protocol.


setIsSecure

public void setIsSecure(boolean isSecure)
Sets whether the cookie will only be sent over a secure protocol.


headerString

public java.lang.String headerString()
Returns the string as it appears in the HTTP header of the response. This would normally be called by WOResponse, but is handled automatically by the servlet implementation.



Copyright © 2006 null. All Rights Reserved.