|
Oracle Application Server HTTPClient Java API Reference 10g Release 3 (10.1.3.1.0) B32117-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
HTTPClient.Cookie
This class represents an http cookie as specified in Netscape's cookie spec; however, because not even Netscape follows their own spec, and because very few folks out there actually read specs but instead just look whether Netscape accepts their stuff, the Set-Cookie header field parser actually tries to follow what Netscape has implemented, instead of what the spec says. Additionally, the parser it will also recognize the Max-Age parameter from rfc-2109, as that uses the same header field (Set-Cookie).
Some notes about how Netscape (4.7) parses:
Field Summary | |
protected java.lang.String |
domain |
protected java.util.Date |
expires |
protected java.lang.String |
name |
protected java.lang.String |
path |
protected boolean |
secure |
protected java.lang.String |
value |
protected int |
version |
Constructor Summary | |
protected |
Cookie(java.lang.String _host, java.lang.String _uri) Use parse() to create cookies. |
|
Cookie(java.lang.String name, java.lang.String value, java.lang.String domain, java.lang.String path, java.util.Date expires, boolean secure) Create a cookie. |
Method Summary | |
boolean |
discard() |
boolean |
equals(java.lang.Object obj) Two cookies match if the name, path and domain match. |
java.util.Date |
expires() |
java.lang.String |
getDomain() Return the domain this cookie is valid in. |
java.lang.String |
getName() Return the name of this cookie. |
java.lang.String |
getPath() Return the path this cookie is associated with. |
java.lang.String |
getValue() Return the value of this cookie. |
boolean |
hasExpired() |
int |
hashCode() Hash up name, path and domain into new hash. |
boolean |
isSecure() Return whether this cookie should only be sent over secure connections. |
protected static Cookie[] |
parse(java.lang.String set_cookie, java.lang.String _host, java.lang.String _uri) Parses the Set-Cookie 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. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.lang.String name
protected java.lang.String value
protected java.util.Date expires
protected java.lang.String domain
protected java.lang.String path
protected boolean secure
protected int version
Constructor Detail |
public Cookie(java.lang.String name, java.lang.String value, java.lang.String domain, java.lang.String path, java.util.Date expires, boolean secure)
name
- the cookie namevalue
- the cookie valuedomain
- the host this cookie will be sent topath
- the path prefix for which this cookie will be sentexpires
- the Date this cookie expires, null if at end of sessionsecure
- if true this cookie will only be over secure connectionsjava.lang.NullPointerException
- if name, value, domain, or path is nullprotected Cookie(java.lang.String _host, java.lang.String _uri)
parse()
to create cookies.parse(String, String, String)
Method Detail |
protected static Cookie[] parse(java.lang.String set_cookie, java.lang.String _host, java.lang.String _uri) throws java.net.ProtocolException
set_cookie
- the Set-Cookie header received from the server_host
- the host for the request_uri
- the uri for the requestjava.net.ProtocolException
- if an error occurs during parsingpublic java.lang.String getName()
public java.lang.String getValue()
public java.util.Date expires()
public boolean discard()
public java.lang.String getDomain()
public java.lang.String getPath()
public boolean isSecure()
public boolean hasExpired()
protected boolean sendWith(RoRequest req)
req
- the request to be sentpublic int hashCode()
public boolean equals(java.lang.Object obj)
protected java.lang.String toExternalForm()
public java.lang.String toString()
|
Oracle Application Server HTTPClient Java API Reference 10g Release 3 (10.1.3.1.0) B32117-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |