|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.webdav.lib.NameValuePair | +--org.apache.webdav.lib.Cookie
This class represents an http cookie as specified in RFC 2109.
Field Summary | |
protected java.lang.String |
m_comment
|
protected java.lang.String |
m_domain
|
protected java.util.Date |
m_expiryDate
|
protected java.lang.String |
m_path
|
protected boolean |
m_secure
|
protected int |
m_version
|
Fields inherited from class org.apache.webdav.lib.NameValuePair |
name, value |
Constructor Summary | |
Cookie(java.lang.String domain,
java.lang.String name,
java.lang.String value)
Create a cookie. |
Method Summary | |
static Header |
createCookieHeader(java.lang.String domain,
java.lang.String path,
java.util.Vector cookies)
|
boolean |
equals(java.lang.Object obj)
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. |
java.lang.String |
getDomain()
Returns the domain of this cookie. |
java.util.Date |
getExpiryDate()
|
java.lang.String |
getPath()
Return the path this cookie is associated with. |
boolean |
getSecure()
Return whether this cookie should only be sent over secure connections. |
int |
getVersion()
|
int |
hashCode()
Hash up name, path and domain into new hash. |
boolean |
isExpired()
|
boolean |
isToBeDiscarded()
|
static Cookie[] |
parse(java.lang.String domain,
Header setCookie)
Parses the Set-Cookie header into an array of Cookies. |
void |
setComment(java.lang.String comment)
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 domain)
This cookie should be presented only to hosts satisfying this domain name pattern. |
void |
setExpiryDate(java.util.Date expiryDate)
|
void |
setPath(java.lang.String path)
This cookie should be presented only with requests beginning with this URL. |
void |
setSecure(boolean secure)
Indicates to the user agent that the cookie should only be sent using a secure protocol (https). |
void |
setVersion(int version)
|
java.lang.String |
toExternalForm()
|
java.lang.String |
toString()
Get a String representation of the header. |
Methods inherited from class org.apache.webdav.lib.NameValuePair |
getName, getValue, setName, setValue |
Methods inherited from class java.lang.Object |
|
Field Detail |
protected java.lang.String m_comment
protected java.lang.String m_domain
protected java.util.Date m_expiryDate
protected java.lang.String m_path
protected boolean m_secure
protected int m_version
Constructor Detail |
public Cookie(java.lang.String domain, java.lang.String name, java.lang.String value)
name
- the cookie namevalue
- the cookie valuedomain
- the host this cookie will be sent topath
- the path prefix for which this cookie will be sentmaxAge
- the Date this cookie expires, null if the cookie
expires at the end of the sessionsecure
- if true this cookie will only be over secure connectionsNullPointerException
- if name, value or
domain is nullMethod Detail |
public java.lang.String getComment()
setComment(String)
public void setComment(java.lang.String comment)
getComment()
public java.util.Date getExpiryDate()
public void setExpiryDate(java.util.Date expiryDate)
public boolean isToBeDiscarded()
public java.lang.String getDomain()
setDomain(String)
public void setDomain(java.lang.String domain)
getDomain()
public java.lang.String getPath()
public void setPath(java.lang.String path)
public boolean getSecure()
public void setSecure(boolean secure)
getSecure()
public int getVersion()
public void setVersion(int version)
public boolean isExpired()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class NameValuePair
public java.lang.String toExternalForm()
public static Header createCookieHeader(java.lang.String domain, java.lang.String path, java.util.Vector cookies)
public java.lang.String toString()
NameValuePair
toString
in class NameValuePair
public static Cookie[] parse(java.lang.String domain, Header setCookie) throws WebdavException
The syntax for the Set-Cookie response header is:
set-cookie = "Set-Cookie:" cookies cookies = 1#cookie cookie = NAME "=" VALUE * (";" cookie-av) NAME = attr VALUE = value cookie-av = "Comment" "=" value | "Domain" "=" value | "Max-Age" "=" value | "Path" "=" value | "Secure" | "Version" "=" 1*DIGIT
domain
- the domainsetCookie
- the Set-Cookie header received from the serverWebdavException
- if an error occurs during parsing
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |