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

Constructor Index

 o Cookie(String, String, String, String, Date, boolean)
Create a cookie.

Method Index

 o discard()
 o equals(Object)
Two cookies match if the name, path and domain match.
 o expires()
 o getDomain()
Return the domain this cookie is valid in.
 o getName()
Return the name of this cookie.
 o getPath()
Return the path this cookie is associated with.
 o getValue()
Return the value of this cookie.
 o hasExpired()
 o hashCode()
Hash up name, path and domain into new hash.
 o isSecure()
Return whether this cookie should only be sent over secure connections.
 o toString()
Create a string containing all the cookie fields.

Constructors

 o 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

Methods

 o getName
 public String getName()
Return the name of this cookie.

 o getValue
 public String getValue()
Return the value of this cookie.

 o expires
 public Date expires()
Returns:
the expiry date of this cookie, or null if none set.
 o discard
 public boolean discard()
Returns:
true if the cookie should be discarded at the end of the session; false otherwise
 o getDomain
 public String getDomain()
Return the domain this cookie is valid in.

 o getPath
 public String getPath()
Return the path this cookie is associated with.

 o isSecure
 public boolean isSecure()
Return whether this cookie should only be sent over secure connections.

 o hasExpired
 public boolean hasExpired()
Returns:
true if this cookie has expired
 o hashCode
 public int hashCode()
Hash up name, path and domain into new hash.

Overrides:
hashCode in class Object
 o equals
 public boolean equals(Object obj)
Two cookies match if the name, path and domain match.

Overrides:
equals in class Object
 o 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