| org.apache.commons.httpclient.Cookie org.apache.commons.httpclient.cookie.Cookie2
Constructor Summary | |
public | Cookie2() Default constructor. | public | Cookie2(String domain, String name, String value) Creates a cookie with the given name, value and domain attribute. | public | Cookie2(String domain, String name, String value, String path, Date expires, boolean secure) | public | 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 | |
public 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. | public int[] | getPorts() Get the Port attribute. | public boolean | isPersistent() Returns false if the cookie should be discarded at the end
of the "session"; true otherwise. | public boolean | isPortAttributeBlank() | public boolean | isPortAttributeSpecified() | public boolean | isVersionAttributeSpecified() | public 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. | public void | setDiscard(boolean toDiscard) Set the Discard attribute. | public void | setPortAttributeBlank(boolean value) Indicates whether the Port attribute in Set-Cookie2 header
contains no value (is of the form Port=""). | public void | setPortAttributeSpecified(boolean value) Indicates whether the cookie had a port attribute specified in the
Set-Cookie2 response header. | public void | setPorts(int[] ports) Set the Port attribute. | public void | setVersionAttributeSpecified(boolean value) Indicates whether the cookie had a version attribute specified in the
Set-Cookie2 response header. | public String | toExternalForm() Return a textual representation of the cookie. |
Cookie2 | public Cookie2()(Code) | | Default constructor. Creates a blank cookie
|
Cookie2 | public Cookie2(String domain, String name, String value)(Code) | | Creates a cookie with the given name, value and domain attribute.
Parameters: name - the cookie name Parameters: value - the cookie value Parameters: domain - the domain this cookie can be sent to |
Cookie2 | public Cookie2(String domain, String name, String value, String path, Date expires, boolean secure)(Code) | | Creates a cookie with the given name, value, domain attribute,
path attribute, expiration attribute, and secure attribute
Parameters: name - the cookie name Parameters: value - the cookie value Parameters: domain - the domain this cookie can be sent to Parameters: path - the path prefix for which this cookie can be sent Parameters: expires - the Date at which this cookie expires,or null if the cookie expires at the endof the session Parameters: secure - if true this cookie can only be sent over secureconnections throws: IllegalArgumentException - If cookie name is null or blank,cookie name contains a blank, or cookie name starts with character $ |
Cookie2 | public Cookie2(String domain, String name, String value, String path, Date expires, boolean secure, int[] ports)(Code) | | Creates a cookie with the given name, value, domain attribute,
path attribute, expiration attribute, secure attribute, and ports
attribute.
Parameters: name - the cookie name Parameters: value - the cookie value Parameters: domain - the domain this cookie can be sent to Parameters: path - the path prefix for which this cookie can be sent Parameters: expires - the Date at which this cookie expires,or null if the cookie expires at the endof the session Parameters: secure - if true this cookie can only be sent over secureconnections Parameters: ports - the ports for which this cookie can be sent throws: IllegalArgumentException - If cookie name is null or blank,cookie name contains a blank, or cookie name starts with character $ |
getCommentURL | public String getCommentURL()(Code) | | 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.
See Also: Cookie2.setCommentURL(String) |
getPorts | public int[] getPorts()(Code) | | Get the Port attribute. It restricts the ports to which a cookie
may be returned in a Cookie request header.
See Also: Cookie2.setPorts(int[]) |
isPersistent | public boolean isPersistent()(Code) | | Returns false if the cookie should be discarded at the end
of the "session"; true otherwise.
false if the cookie should be discarded at the endof the "session"; true otherwise |
isPortAttributeBlank | public boolean isPortAttributeBlank()(Code) | | true if the port attribute in Set-Cookie2 headerhad no value (was of the form Port=""). See Also: Cookie2.setPortAttributeBlank |
setCommentURL | public void setCommentURL(String commentURL)(Code) | | 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.
Parameters: commentURL - See Also: Cookie2.getCommentURL() |
setDiscard | public void setDiscard(boolean toDiscard)(Code) | | Set the Discard attribute.
Note: Discard attribute overrides Max-age.
See Also: Cookie2.isPersistent() |
setPortAttributeBlank | public void setPortAttributeBlank(boolean value)(Code) | | Indicates whether the Port attribute in Set-Cookie2 header
contains no value (is of the form Port="").
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.
Parameters: value - true if port attribute is specified as blank in responseheader. See Also: Cookie2.isPortAttributeBlank |
setPortAttributeSpecified | public void setPortAttributeSpecified(boolean value)(Code) | | Indicates whether the cookie had a port attribute specified in the
Set-Cookie2 response header.
Parameters: value - true if port attribute is specified in responseheader. See Also: Cookie2.isPortAttributeSpecified |
setPorts | public void setPorts(int[] ports)(Code) | | Set the Port attribute. It restricts the ports to which a cookie
may be returned in a Cookie request header.
Parameters: ports - See Also: Cookie2.getPorts() |
setVersionAttributeSpecified | public void setVersionAttributeSpecified(boolean value)(Code) | | Indicates whether the cookie had a version attribute specified in the
Set-Cookie2 response header.
Parameters: value - true if version attribute is specified in responseheader. See Also: Cookie2.isVersionAttributeSpecified() |
toExternalForm | public String toExternalForm()(Code) | | Return a textual representation of the cookie.
string. |
|
|