All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class HTTPClient.Cookie2

java.lang.Object
   |
   +----HTTPClient.Cookie
           |
           +----HTTPClient.Cookie2

public class Cookie2
extends Cookie
This class represents an http cookie as specified in the HTTP State Management Mechanism spec (also known as a version 1 cookie).

Version:
0.3-2 18/06/1999
Author:
Ronald Tschalär

Constructor Index

 o Cookie2(String, String, String, int[], String, Date, boolean, boolean, String, URI)
Create a cookie.

Method Index

 o discard()
 o getComment()
 o getCommentURL()
 o getPorts()
 o getVersion()
 o toString()
Create a string containing all the cookie fields.

Constructors

 o Cookie2
 public Cookie2(String name,
                String value,
                String domain,
                int port_list[],
                String path,
                Date expires,
                boolean discard,
                boolean secure,
                String comment,
                URI comment_url)
Create a cookie.

Parameters:
name - the cookie name
value - the cookie value
domain - the host this cookie will be sent to
port_list - an array of allowed server ports for this cookie, or null if the the cookie may be sent to any port
path - the path prefix for which this cookie will be sent
epxires - the Date this cookie expires, or null if never
discard - if true then the cookie will be discarded at the end of the session regardless of expiry
secure - if true this cookie will only be over secure connections
comment - the comment associated with this cookie, or null if none
comment_url - the comment URL associated with this cookie, or null if none
Throws: NullPointerException
if name, value, domain, or path is null

Methods

 o getVersion
 public int getVersion()
Returns:
the version as an int
 o getComment
 public String getComment()
Returns:
the comment string, or null if none was set
 o getCommentURL
 public URI getCommentURL()
Returns:
the comment url
 o getPorts
 public int[] getPorts()
Returns:
the array of ports
 o discard
 public boolean discard()
Returns:
true if the cookie should be discarded at the end of the session; false otherwise
Overrides:
discard in class Cookie
 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 Cookie

All Packages  Class Hierarchy  This Package  Previous  Next  Index