|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.microsoft.tfs.core.httpclient.cookie.IgnoreCookiesSpec
public class IgnoreCookiesSpec
A cookie spec that does nothing. Cookies are neither parsed, formatted nor matched. It can be used to effectively disable cookies altogether.
Field Summary |
---|
Fields inherited from interface com.microsoft.tfs.core.httpclient.cookie.CookieSpec |
---|
PATH_DELIM, PATH_DELIM_CHAR |
Constructor Summary | |
---|---|
IgnoreCookiesSpec()
|
Method Summary | |
---|---|
boolean |
domainMatch(java.lang.String host,
java.lang.String domain)
Performs domain-match as defined by the cookie specification. |
java.lang.String |
formatCookie(Cookie cookie)
Create a "Cookie" header value for an array of cookies. |
Header |
formatCookieHeader(Cookie cookie)
Create a "Cookie" Header for single Cookie. |
Header |
formatCookieHeader(Cookie[] cookies)
Create a "Cookie" Header for an array of Cookies. |
java.lang.String |
formatCookies(Cookie[] cookies)
Create a "Cookie" header value for an array of cookies. |
java.util.Collection<java.text.SimpleDateFormat> |
getValidDateFormats()
Returns the Collection of date patterns used for parsing. |
boolean |
match(java.lang.String host,
int port,
java.lang.String path,
boolean secure,
Cookie cookie)
Determines if a Cookie matches a location. |
Cookie[] |
match(java.lang.String host,
int port,
java.lang.String path,
boolean secure,
Cookie[] cookies)
Returns an empty cookie array. |
Cookie[] |
parse(java.lang.String host,
int port,
java.lang.String path,
boolean secure,
Header header)
Returns an empty cookie array. |
Cookie[] |
parse(java.lang.String host,
int port,
java.lang.String path,
boolean secure,
java.lang.String header)
Returns an empty cookie array. |
Cookie[] |
parse(java.net.URI uri,
Header header)
Returns an empty cookie array. |
Cookie[] |
parse(java.net.URI uri,
java.lang.String header)
Returns an empty cookie array. |
void |
parseAttribute(NameValuePair attribute,
Cookie cookie)
Does nothing. |
boolean |
pathMatch(java.lang.String path,
java.lang.String topmostPath)
Performs path-match as defined by the cookie specification. |
void |
setValidDateFormats(java.util.Collection<java.text.SimpleDateFormat> datepatterns)
Does nothing. |
void |
validate(java.lang.String host,
int port,
java.lang.String path,
boolean secure,
Cookie cookie)
Does nothing. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IgnoreCookiesSpec()
Method Detail |
---|
public Cookie[] parse(java.lang.String host, int port, java.lang.String path, boolean secure, java.lang.String header) throws MalformedCookieException
cookie
array. All parameters are ignored.
parse
in interface CookieSpec
host
- the host which sent the Set-Cookie headerport
- the port which sent the Set-Cookie headerpath
- the path which sent the Set-Cookie headersecure
- true when the Set-Cookie header was received
over secure conectionheader
- the Set-Cookie received from the server
CookieSpec.validate(String, int, String, boolean, Cookie)
MalformedCookieException
- if an exception occurs during parsingpublic java.util.Collection<java.text.SimpleDateFormat> getValidDateFormats()
CookieSpec
Collection
of date patterns used for parsing. The
String patterns are compatible with the
SimpleDateFormat
.
getValidDateFormats
in interface CookieSpec
null
public void setValidDateFormats(java.util.Collection<java.text.SimpleDateFormat> datepatterns)
setValidDateFormats
in interface CookieSpec
datepatterns
- collection of date patternspublic java.lang.String formatCookie(Cookie cookie)
CookieSpec
formatCookie
in interface CookieSpec
cookie
- the cookie to be formatted as string
null
public Header formatCookieHeader(Cookie cookie) throws java.lang.IllegalArgumentException
CookieSpec
formatCookieHeader
in interface CookieSpec
cookie
- the Cookie format as a Cookie header
null
java.lang.IllegalArgumentException
- if an input parameter is illegalpublic Header formatCookieHeader(Cookie[] cookies) throws java.lang.IllegalArgumentException
CookieSpec
formatCookieHeader
in interface CookieSpec
cookies
- the Cookies format into a Cookie header
null
java.lang.IllegalArgumentException
- if an input parameter is illegalpublic java.lang.String formatCookies(Cookie[] cookies) throws java.lang.IllegalArgumentException
CookieSpec
formatCookies
in interface CookieSpec
cookies
- the Cookies to be formatted
null
java.lang.IllegalArgumentException
- if an input parameter is illegalpublic boolean match(java.lang.String host, int port, java.lang.String path, boolean secure, Cookie cookie)
CookieSpec
match
in interface CookieSpec
host
- the host to which the request is being submittedport
- the port to which the request is being submittedpath
- the path to which the request is being submittedsecure
- true if the request is using a secure connectioncookie
- the Cookie to be matched
false
public Cookie[] match(java.lang.String host, int port, java.lang.String path, boolean secure, Cookie[] cookies)
cookie
array. All parameters are ignored.
match
in interface CookieSpec
host
- the host to which the request is being submittedport
- the port to which the request is being submitted (currenlty
ignored)path
- the path to which the request is being submittedsecure
- true if the request is using a secure protocolcookies
- an array of Cookies to be matched
public Cookie[] parse(java.net.URI uri, Header header) throws MalformedCookieException, java.lang.IllegalArgumentException
cookie
array. All parameters are ignored.
parse
in interface CookieSpec
uri
- the uri that sent the Set-Cookie headerheader
- the Set-Cookie received from the server
CookieSpec.validate(String, int, String, boolean, Cookie)
MalformedCookieException
- if an exception occurs during parsing
java.lang.IllegalArgumentException
- if an input parameter is illegalpublic Cookie[] parse(java.net.URI uri, java.lang.String header) throws MalformedCookieException, java.lang.IllegalArgumentException
cookie
array. All parameters are ignored.
parse
in interface CookieSpec
uri
- the uri that sent the Set-Cookie headerheader
- the Set-Cookie received from the server
CookieSpec.validate(String, int, String, boolean, Cookie)
MalformedCookieException
- if an exception occurs during parsing
java.lang.IllegalArgumentException
- if an input parameter is illegalpublic Cookie[] parse(java.lang.String host, int port, java.lang.String path, boolean secure, Header header) throws MalformedCookieException, java.lang.IllegalArgumentException
cookie
array. All parameters are ignored.
parse
in interface CookieSpec
host
- the host which sent the Set-Cookie headerport
- the port which sent the Set-Cookie headerpath
- the path which sent the Set-Cookie headersecure
- true when the Set-Cookie header was received
over secure conectionheader
- the Set-Cookie received from the server
CookieSpec.validate(String, int, String, boolean, Cookie)
MalformedCookieException
- if an exception occurs during parsing
java.lang.IllegalArgumentException
- if an input parameter is illegalpublic void parseAttribute(NameValuePair attribute, Cookie cookie) throws MalformedCookieException, java.lang.IllegalArgumentException
parseAttribute
in interface CookieSpec
attribute
- cookie attribute from the Set-Cookiecookie
- the to be updated
MalformedCookieException
- if an exception occurs during parsing
java.lang.IllegalArgumentException
- if an input parameter is illegalpublic void validate(java.lang.String host, int port, java.lang.String path, boolean secure, Cookie cookie) throws MalformedCookieException, java.lang.IllegalArgumentException
validate
in interface CookieSpec
host
- the host from which the Cookie
was receivedport
- the port from which the Cookie
was receivedpath
- the path from which the Cookie
was receivedsecure
- true when the Cookie
was received using a secure
connectioncookie
- the Cookie to validate
MalformedCookieException
- if the cookie is invalid
java.lang.IllegalArgumentException
- if an input parameter is illegalpublic boolean domainMatch(java.lang.String host, java.lang.String domain)
CookieSpec
domainMatch
in interface CookieSpec
host
- The target host.domain
- The cookie domain attribute.
false
public boolean pathMatch(java.lang.String path, java.lang.String topmostPath)
CookieSpec
pathMatch
in interface CookieSpec
path
- The target path.topmostPath
- The cookie path attribute.
false
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |