public class Cookie2 extends Cookie
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
comment |
protected URI |
comment_url |
protected boolean |
discard |
protected boolean |
domain_set |
protected boolean |
path_set |
protected int[] |
port_list |
protected java.lang.String |
port_list_str |
protected boolean |
port_set |
protected int |
version |
| Modifier | Constructor and Description |
|---|---|
protected |
Cookie2(RoRequest req)
Use
parse() to create cookies. |
|
Cookie2(java.lang.String name,
java.lang.String value,
java.lang.String domain,
int[] port_list,
java.lang.String path,
java.util.Date expires,
boolean discard,
boolean secure,
java.lang.String comment,
URI comment_url)
Create a cookie.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
discard() |
java.lang.String |
getComment() |
URI |
getCommentURL() |
int[] |
getPorts() |
int |
getVersion() |
protected static Cookie[] |
parse(java.lang.String set_cookie,
RoRequest req)
Parses the Set-Cookie2 header into an array of Cookies.
|
protected boolean |
sendWith(RoRequest req) |
protected java.lang.String |
toExternalForm() |
java.lang.String |
toString()
Create a string containing all the cookie fields.
|
protected int version
protected boolean discard
protected java.lang.String comment
protected URI comment_url
protected int[] port_list
protected java.lang.String port_list_str
protected boolean path_set
protected boolean port_set
protected boolean domain_set
public Cookie2(java.lang.String name,
java.lang.String value,
java.lang.String domain,
int[] port_list,
java.lang.String path,
java.util.Date expires,
boolean discard,
boolean secure,
java.lang.String comment,
URI comment_url)
name - the cookie namevalue - the cookie valuedomain - the host this cookie will be sent toport_list - an array of allowed server ports for this cookie,
or null if the the cookie may be sent to any portpath - the path prefix for which this cookie will be sentepxires - the Date this cookie expires, or null if neverdiscard - if true then the cookie will be discarded at the
end of the session regardless of expirysecure - if true this cookie will only be over secure connectionscomment - the comment associated with this cookie, or null if nonecomment_url - the comment URL associated with this cookie, or null
if nonejava.lang.NullPointerException - if name, value,
domain, or path
is nullprotected Cookie2(RoRequest req)
parse() to create cookies.protected static Cookie[] parse(java.lang.String set_cookie, RoRequest req) throws java.net.ProtocolException
set_cookie - the Set-Cookie2 header received from the serverreq - the request usedjava.net.ProtocolException - if an error occurs during parsingpublic int getVersion()
public java.lang.String getComment()
public URI getCommentURL()
public int[] getPorts()
public boolean discard()
protected boolean sendWith(RoRequest req)
protected java.lang.String toExternalForm()
toExternalForm in class Cookie