All Packages Class Hierarchy This Package Previous Next Index
Class HTTPClient.Cookie
java.lang.Object
|
+----HTTPClient.Cookie
- public class Cookie
- extends Object
- implements Serializable
This class represents an http cookie as specified in
Netscape's
cookie spec
- Version:
- 0.3-2 18/06/1999
- Author:
- Ronald Tschalär
-
Cookie(String, String, String, String, Date, boolean)
- Create a cookie.
-
discard()
-
-
equals(Object)
- Two cookies match if the name, path and domain match.
-
expires()
-
-
getDomain()
- Return the domain this cookie is valid in.
-
getName()
- Return the name of this cookie.
-
getPath()
- Return the path this cookie is associated with.
-
getValue()
- Return the value of this cookie.
-
hasExpired()
-
-
hashCode()
- Hash up name, path and domain into new hash.
-
isSecure()
- Return whether this cookie should only be sent over secure connections.
-
toString()
- Create a string containing all the cookie fields.
Cookie
public Cookie(String name,
String value,
String domain,
String path,
Date expires,
boolean secure)
- Create a cookie.
- Parameters:
- name - the cookie name
- value - the cookie value
- domain - the host this cookie will be sent to
- path - the path prefix for which this cookie will be sent
- epxires - the Date this cookie expires, null if at end of
session
- secure - if true this cookie will only be over secure connections
- Throws: NullPointerException
- if name, value,
domain, or path
is null
getName
public String getName()
- Return the name of this cookie.
getValue
public String getValue()
- Return the value of this cookie.
expires
public Date expires()
- Returns:
- the expiry date of this cookie, or null if none set.
discard
public boolean discard()
- Returns:
- true if the cookie should be discarded at the end of the
session; false otherwise
getDomain
public String getDomain()
- Return the domain this cookie is valid in.
getPath
public String getPath()
- Return the path this cookie is associated with.
isSecure
public boolean isSecure()
- Return whether this cookie should only be sent over secure connections.
hasExpired
public boolean hasExpired()
- Returns:
- true if this cookie has expired
hashCode
public int hashCode()
- Hash up name, path and domain into new hash.
- Overrides:
- hashCode in class Object
equals
public boolean equals(Object obj)
- Two cookies match if the name, path and domain match.
- Overrides:
- equals in class Object
toString
public String toString()
- Create a string containing all the cookie fields. The format is that
used in the Set-Cookie header.
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index