|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gargoylesoftware.htmlunit.util.Cookie
public class Cookie
A cookie. This class is immutable.
Constructor Summary | |
---|---|
Cookie(String name,
String value)
Creates a new cookie with the specified name and value. |
|
Cookie(String domain,
String name,
String value)
Creates a new cookie with the specified name and value which applies to the specified domain. |
|
Cookie(String domain,
String name,
String value,
String path,
Date expires,
boolean secure)
Creates a new cookie with the specified name and value which applies to the specified domain, the specified path, and expires on the specified date. |
|
Cookie(String domain,
String name,
String value,
String path,
int maxAge,
boolean secure)
Creates a new cookie with the specified name and value which applies to the specified domain, the specified path, and expires after the specified amount of time. |
Method Summary | |
---|---|
boolean |
equals(Object o)
|
static List<Cookie> |
fromHttpClient(List<Cookie> cookies)
Converts the specified array of HttpClient cookies into a list of cookies. |
String |
getDomain()
Returns the domain to which this cookie applies (null for all domains). |
Date |
getExpires()
Returns the date on which this cookie expires (null if it never expires). |
String |
getName()
Returns the cookie name. |
String |
getPath()
Returns the path to which this cookie applies (null for all paths). |
String |
getValue()
Returns the cookie value. |
int |
hashCode()
|
boolean |
isSecure()
Returns whether or not this cookie is secure (i.e. |
Cookie |
toHttpClient()
Converts this cookie to an HttpClient cookie. |
static Cookie[] |
toHttpClient(Collection<Cookie> cookies)
Converts the specified collection of cookies into an array of HttpClient cookies. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Cookie(String name, String value)
name
- the cookie namevalue
- the cookie namepublic Cookie(String domain, String name, String value)
domain
- the domain to which this cookie appliesname
- the cookie namevalue
- the cookie namepublic Cookie(String domain, String name, String value, String path, Date expires, boolean secure)
domain
- the domain to which this cookie appliesname
- the cookie namevalue
- the cookie namepath
- the path to which this cookie appliesexpires
- the date on which this cookie expiressecure
- whether or not this cookie is secure (i.e. HTTPS vs HTTP)public Cookie(String domain, String name, String value, String path, int maxAge, boolean secure)
domain
- the domain to which this cookie appliesname
- the cookie namevalue
- the cookie namepath
- the path to which this cookie appliesmaxAge
- the number of seconds for which this cookie is valid; -1 indicates that the
cookie should never expire; other negative numbers are not allowedsecure
- whether or not this cookie is secure (i.e. HTTPS vs HTTP)Method Detail |
---|
public String getName()
public String getValue()
public String getDomain()
public String getPath()
public Date getExpires()
public boolean isSecure()
public String toString()
toString
in class Object
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public Cookie toHttpClient()
public static Cookie[] toHttpClient(Collection<Cookie> cookies)
cookies
- the cookies to be converted
public static List<Cookie> fromHttpClient(List<Cookie> cookies)
cookies
- the cookies to be converted
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |