|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.httpclient.NameValuePair org.apache.commons.httpclient.Cookie org.apache.commons.httpclient.cookie.Cookie2
public class Cookie2
Cookie class for RFC2965Spec
cookie specification. It extends Cookie
class and adds newer cookie
attributes and functions required for this specification.
Field Summary | |
---|---|
static String |
COMMENT
|
static String |
COMMENTURL
|
static String |
DISCARD
|
static String |
DOMAIN
|
static String |
MAXAGE
|
static String |
PATH
|
static String |
PORT
|
static String |
SECURE
|
static String |
VERSION
|
Constructor Summary | |
---|---|
Cookie2()
Default constructor. |
|
Cookie2(String domain,
String name,
String value)
Creates a cookie with the given name, value and domain attribute. |
|
Cookie2(String domain,
String name,
String value,
String path,
Date expires,
boolean secure)
Creates a cookie with the given name, value, domain attribute, path attribute, expiration attribute, and secure attribute |
|
Cookie2(String domain,
String name,
String value,
String path,
Date expires,
boolean secure,
int[] ports)
Creates a cookie with the given name, value, domain attribute, path attribute, expiration attribute, secure attribute, and ports attribute. |
Method Summary | |
---|---|
String |
getCommentURL()
If a user agent (web browser) presents this cookie to a user, the cookie's purpose will be described by the information at this URL. |
int[] |
getPorts()
Get the Port attribute. |
boolean |
isPersistent()
Returns false if the cookie should be discarded at the end of the "session"; true otherwise. |
boolean |
isPortAttributeBlank()
|
boolean |
isPortAttributeSpecified()
|
boolean |
isVersionAttributeSpecified()
|
void |
setCommentURL(String commentURL)
If a user agent (web browser) presents this cookie to a user, the cookie's purpose will be described by the information at this URL. |
void |
setDiscard(boolean toDiscard)
Set the Discard attribute. |
void |
setPortAttributeBlank(boolean value)
Indicates whether the Port attribute in Set-Cookie2 header contains no value (is of the form Port=""). |
void |
setPortAttributeSpecified(boolean value)
Indicates whether the cookie had a port attribute specified in the Set-Cookie2 response header. |
void |
setPorts(int[] ports)
Set the Port attribute. |
void |
setVersionAttributeSpecified(boolean value)
Indicates whether the cookie had a version attribute specified in the Set-Cookie2 response header. |
String |
toExternalForm()
Return a textual representation of the cookie. |
Methods inherited from class org.apache.commons.httpclient.Cookie |
---|
compare, equals, getComment, getDomain, getExpiryDate, getPath, getSecure, getVersion, hashCode, isDomainAttributeSpecified, isExpired, isExpired, isPathAttributeSpecified, setComment, setDomain, setDomainAttributeSpecified, setExpiryDate, setPath, setPathAttributeSpecified, setSecure, setVersion, toString |
Methods inherited from class org.apache.commons.httpclient.NameValuePair |
---|
getName, getValue, setName, setValue |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String DOMAIN
public static final String PATH
public static final String PORT
public static final String VERSION
public static final String SECURE
public static final String MAXAGE
public static final String COMMENT
public static final String COMMENTURL
public static final String DISCARD
Constructor Detail |
---|
public Cookie2()
public Cookie2(String domain, String name, String value)
name
- the cookie namevalue
- the cookie valuedomain
- the domain this cookie can be sent topublic Cookie2(String domain, String name, String value, String path, Date expires, boolean secure)
name
- the cookie namevalue
- the cookie valuedomain
- the domain this cookie can be sent topath
- the path prefix for which this cookie can be sentexpires
- the Date
at which this cookie expires,
or null if the cookie expires at the end
of the sessionsecure
- if true this cookie can only be sent over secure
connections
IllegalArgumentException
- If cookie name is null or blank,
cookie name contains a blank, or cookie name starts with character $public Cookie2(String domain, String name, String value, String path, Date expires, boolean secure, int[] ports)
name
- the cookie namevalue
- the cookie valuedomain
- the domain this cookie can be sent topath
- the path prefix for which this cookie can be sentexpires
- the Date
at which this cookie expires,
or null if the cookie expires at the end
of the sessionsecure
- if true this cookie can only be sent over secure
connectionsports
- the ports for which this cookie can be sent
IllegalArgumentException
- If cookie name is null or blank,
cookie name contains a blank, or cookie name starts with character $Method Detail |
---|
public String getCommentURL()
setCommentURL(String)
public void setCommentURL(String commentURL)
commentURL
- getCommentURL()
public int[] getPorts()
setPorts(int[])
public void setPorts(int[] ports)
ports
- getPorts()
public void setDiscard(boolean toDiscard)
isPersistent()
public boolean isPersistent()
isPersistent
in class Cookie
public void setPortAttributeSpecified(boolean value)
value
- true if port attribute is specified in response
header.isPortAttributeSpecified()
public boolean isPortAttributeSpecified()
setPortAttributeSpecified(boolean)
public void setPortAttributeBlank(boolean value)
This value is required for generating the Cookie request header because the specification requires that if Set-Cookie2 header contains a blank value for port attribute, the Cookie header should also contain a port attribute with no value.
value
- true if port attribute is specified as blank in response
header.isPortAttributeBlank
public boolean isPortAttributeBlank()
setPortAttributeBlank(boolean)
public void setVersionAttributeSpecified(boolean value)
value
- true if version attribute is specified in response
header.isVersionAttributeSpecified()
public boolean isVersionAttributeSpecified()
setVersionAttributeSpecified(boolean)
public String toExternalForm()
toExternalForm
in class Cookie
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |