|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cactus.Cookie
Client cookie. Used for manipulating client cookies either in
beginXXX()
(to send cookies) or in
endXXX()
methods (to assert returned cookies).
Constructor Summary | |
Cookie(java.lang.String theDomain,
java.lang.String theName,
java.lang.String theValue)
Create a cookie. |
Method Summary | |
boolean |
equals(java.lang.Object theObject)
Two cookies match if the name, path and domain match. |
java.lang.String |
getComment()
Returns the comment describing the purpose of this cookie, or null if no such comment has been defined. |
static java.lang.String |
getCookieDomain(WebRequest theRequest,
java.lang.String theRealHost)
Deprecated. use CookieUtil.getCookieDomain(WebRequest, String) |
static java.lang.String |
getCookiePath(WebRequest theRequest,
java.lang.String theRealPath)
Deprecated. use CookieUtil.getCookiePath(WebRequest, String) |
static int |
getCookiePort(WebRequest theRequest,
int theRealPort)
Deprecated. use CookieUtil.getCookiePort(WebRequest, int) |
java.lang.String |
getDomain()
Returns the domain of this cookie. |
java.util.Date |
getExpiryDate()
Return the expiry date. |
java.lang.String |
getName()
|
java.lang.String |
getPath()
Return the path this cookie is associated with. |
java.lang.String |
getValue()
|
int |
hashCode()
Hash up name, value and domain into new hash. |
boolean |
isExpired()
|
boolean |
isSecure()
|
boolean |
isToBeDiscarded()
|
void |
setComment(java.lang.String theComment)
If a user agent (web browser) presents this cookie to a user, the cookie's purpose will be described using this comment. |
void |
setDomain(java.lang.String theDomain)
Sets the cookie domain. |
void |
setExpiryDate(java.util.Date theExpiryDate)
Set the cookie expires date. |
void |
setName(java.lang.String theName)
Sets the cookie name |
void |
setPath(java.lang.String thePath)
Sets the cookie path. |
void |
setSecure(boolean isSecure)
Indicates to the user agent that the cookie should only be sent using a secure protocol (https). |
void |
setValue(java.lang.String theValue)
Sets the cookie value |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Cookie(java.lang.String theDomain, java.lang.String theName, java.lang.String theValue)
theDomain
- the cookie domaintheName
- the cookie nametheValue
- the cookie valueMethod Detail |
public void setName(java.lang.String theName)
theName
- the cookie namepublic java.lang.String getName()
public void setValue(java.lang.String theValue)
theValue
- the cookie valuepublic java.lang.String getValue()
public java.lang.String getComment()
public void setComment(java.lang.String theComment)
theComment
- the cookie's text commentpublic java.util.Date getExpiryDate()
public void setExpiryDate(java.util.Date theExpiryDate)
Netscape's original proposal defined an Expires header that took a date value in a fixed-length variant format in place of Max-Age: Wdy, DD-Mon-YY HH:MM:SS GMT Note that the Expires date format contains embedded spaces, and that "old" cookies did not have quotes around values. Clients that implement to this specification should be aware of "old" cookies and Expires.
theExpiryDate
- the expires date.public boolean isToBeDiscarded()
public java.lang.String getDomain()
public void setDomain(java.lang.String theDomain)
theDomain
- the cookie domainpublic java.lang.String getPath()
public void setPath(java.lang.String thePath)
thePath
- the cookie pathpublic boolean isSecure()
public void setSecure(boolean isSecure)
isSecure
- true if the cookie should be sent over secure
connections onlypublic boolean isExpired()
public int hashCode()
public boolean equals(java.lang.Object theObject)
theObject
- the cookie object to match
public java.lang.String toString()
public static java.lang.String getCookieDomain(WebRequest theRequest, java.lang.String theRealHost)
CookieUtil.getCookieDomain(WebRequest, String)
CookieUtil.getCookieDomain(WebRequest, String)
public static int getCookiePort(WebRequest theRequest, int theRealPort)
CookieUtil.getCookiePort(WebRequest, int)
CookieUtil.getCookiePort(WebRequest, int)
public static java.lang.String getCookiePath(WebRequest theRequest, java.lang.String theRealPath)
CookieUtil.getCookiePath(WebRequest, String)
CookieUtil.getCookiePath(WebRequest, String)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |