|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.microsoft.tfs.core.httpclient.NameValuePair
com.microsoft.tfs.core.httpclient.Cookie
com.microsoft.tfs.core.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 java.lang.String |
COMMENT
|
static java.lang.String |
COMMENTURL
|
static java.lang.String |
DISCARD
|
static java.lang.String |
DOMAIN
|
static java.lang.String |
MAXAGE
|
static java.lang.String |
PATH
|
static java.lang.String |
PORT
|
static java.lang.String |
SECURE
|
static java.lang.String |
VERSION
|
Constructor Summary | |
---|---|
Cookie2()
Default constructor. |
|
Cookie2(java.lang.String domain,
java.lang.String name,
java.lang.String value)
Creates a cookie with the given name, value and domain attribute. |
|
Cookie2(java.lang.String domain,
java.lang.String name,
java.lang.String value,
java.lang.String path,
java.util.Date expires,
boolean secure)
Creates a cookie with the given name, value, domain attribute, path attribute, expiration attribute, and secure attribute |
|
Cookie2(java.lang.String domain,
java.lang.String name,
java.lang.String value,
java.lang.String path,
java.util.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 | |
---|---|
java.lang.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(java.lang.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. |
java.lang.String |
toExternalForm()
Return a textual representation of the cookie. |
Methods inherited from class com.microsoft.tfs.core.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 com.microsoft.tfs.core.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 java.lang.String DOMAIN
"domain"
public static final java.lang.String PATH
"path"
public static final java.lang.String PORT
"port"
public static final java.lang.String VERSION
"version"
public static final java.lang.String SECURE
"secure"
public static final java.lang.String MAXAGE
"max-age"
public static final java.lang.String COMMENT
"comment"
public static final java.lang.String COMMENTURL
"commenturl"
public static final java.lang.String DISCARD
"discard"
Constructor Detail |
---|
public Cookie2()
public Cookie2(java.lang.String domain, java.lang.String name, java.lang.String value)
name
- the cookie namevalue
- the cookie valuedomain
- the domain this cookie can be sent topublic Cookie2(java.lang.String domain, java.lang.String name, java.lang.String value, java.lang.String path, java.util.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
java.lang.IllegalArgumentException
- If cookie name is null or blank, cookie name contains a blank, or
cookie name starts with character $public Cookie2(java.lang.String domain, java.lang.String name, java.lang.String value, java.lang.String path, java.util.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
java.lang.IllegalArgumentException
- If cookie name is null or blank, cookie name contains a blank, or
cookie name starts with character $Method Detail |
---|
public java.lang.String getCommentURL()
setCommentURL(String)
public void setCommentURL(java.lang.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 java.lang.String toExternalForm()
toExternalForm
in class Cookie
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |