org.apache.commons.httpclient.cookie
Class IgnoreCookiesSpec

java.lang.Object
  extended by org.apache.commons.httpclient.cookie.IgnoreCookiesSpec
All Implemented Interfaces:
CookieSpec

public class IgnoreCookiesSpec
extends Object
implements CookieSpec

A cookie spec that does nothing. Cookies are neither parsed, formatted nor matched. It can be used to effectively disable cookies altogether.

Since:
3.0

Field Summary
 
Fields inherited from interface org.apache.commons.httpclient.cookie.CookieSpec
PATH_DELIM, PATH_DELIM_CHAR
 
Constructor Summary
IgnoreCookiesSpec()
           
 
Method Summary
 boolean domainMatch(String host, String domain)
          Performs domain-match as defined by the cookie specification.
 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(List<Cookie> cookies)
          Create a "Cookie" Header for an array of Cookies.
 String formatCookies(List<Cookie> cookies)
          Create a "Cookie" header value for an array of cookies.
 Collection getValidDateFormats()
          Returns the Collection of date patterns used for parsing.
 boolean match(String host, int port, String path, boolean secure, Cookie cookie)
          Determines if a Cookie matches a location.
 List<Cookie> match(String host, int port, String path, boolean secure, List<Cookie> cookies)
          Returns an empty cookie array.
 List<Cookie> parse(String host, int port, String path, boolean secure, Header header)
          Returns an empty cookie array.
 List<Cookie> parse(String host, int port, String path, boolean secure, String header)
          Returns an empty cookie array.
 void parseAttribute(NameValuePair attribute, Cookie cookie)
          Does nothing.
 boolean pathMatch(String path, String topmostPath)
          Performs path-match as defined by the cookie specification.
 void setValidDateFormats(Collection datepatterns)
          Does nothing.
 void validate(String host, int port, 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

IgnoreCookiesSpec

public IgnoreCookiesSpec()
Method Detail

parse

public List<Cookie> parse(String host,
                          int port,
                          String path,
                          boolean secure,
                          String header)
Returns an empty cookie array. All parameters are ignored.

Specified by:
parse in interface CookieSpec
Parameters:
host -
port -
path -
secure -
header -
Returns:
an empty cookie array
See Also:
CookieSpec.validate(String, int, String, boolean, Cookie)

getValidDateFormats

public Collection getValidDateFormats()
Description copied from interface: CookieSpec
Returns the Collection of date patterns used for parsing. The String patterns are compatible with the SimpleDateFormat.

Specified by:
getValidDateFormats in interface CookieSpec
Returns:
null

setValidDateFormats

public void setValidDateFormats(Collection datepatterns)
Does nothing.

Specified by:
setValidDateFormats in interface CookieSpec
Parameters:
datepatterns - ignored

formatCookie

public String formatCookie(Cookie cookie)
Description copied from interface: CookieSpec
Create a "Cookie" header value for an array of cookies.

Specified by:
formatCookie in interface CookieSpec
Parameters:
cookie - ignored
Returns:
null

formatCookieHeader

public Header formatCookieHeader(Cookie cookie)
                          throws IllegalArgumentException
Description copied from interface: CookieSpec
Create a "Cookie" Header for single Cookie.

Specified by:
formatCookieHeader in interface CookieSpec
Parameters:
cookie - ignored
Returns:
null
Throws:
IllegalArgumentException

formatCookieHeader

public Header formatCookieHeader(List<Cookie> cookies)
                          throws IllegalArgumentException
Description copied from interface: CookieSpec
Create a "Cookie" Header for an array of Cookies.

Specified by:
formatCookieHeader in interface CookieSpec
Parameters:
cookies - ignored
Returns:
null
Throws:
IllegalArgumentException

formatCookies

public String formatCookies(List<Cookie> cookies)
                     throws IllegalArgumentException
Description copied from interface: CookieSpec
Create a "Cookie" header value for an array of cookies.

Specified by:
formatCookies in interface CookieSpec
Parameters:
cookies - ignored
Returns:
null
Throws:
IllegalArgumentException

match

public boolean match(String host,
                     int port,
                     String path,
                     boolean secure,
                     Cookie cookie)
Description copied from interface: CookieSpec
Determines if a Cookie matches a location.

Specified by:
match in interface CookieSpec
Parameters:
host - ignored
port - ignored
path - ignored
secure - ignored
cookie - ignored
Returns:
false

match

public List<Cookie> match(String host,
                          int port,
                          String path,
                          boolean secure,
                          List<Cookie> cookies)
Returns an empty cookie array. All parameters are ignored.

Specified by:
match in interface CookieSpec
Parameters:
host - ignored
port - ignored
path - ignored
secure - ignored
cookies - ignored
Returns:
an empty array

parse

public List<Cookie> parse(String host,
                          int port,
                          String path,
                          boolean secure,
                          Header header)
                   throws IllegalArgumentException
Returns an empty cookie array. All parameters are ignored.

Specified by:
parse in interface CookieSpec
Parameters:
host - ignored
port - ignored
path - ignored
secure - ignored
header - ignored
Returns:
an empty array
Throws:
IllegalArgumentException
See Also:
CookieSpec.validate(String, int, String, boolean, Cookie)

parseAttribute

public void parseAttribute(NameValuePair attribute,
                           Cookie cookie)
                    throws IllegalArgumentException
Does nothing.

Specified by:
parseAttribute in interface CookieSpec
Parameters:
attribute - ignored
cookie - ignored
Throws:
IllegalArgumentException

validate

public void validate(String host,
                     int port,
                     String path,
                     boolean secure,
                     Cookie cookie)
              throws IllegalArgumentException
Does nothing.

Specified by:
validate in interface CookieSpec
Parameters:
host - ignored
port - ignored
path - ignored
secure - ignored
cookie - ignored
Throws:
IllegalArgumentException

domainMatch

public boolean domainMatch(String host,
                           String domain)
Description copied from interface: CookieSpec
Performs domain-match as defined by the cookie specification.

Specified by:
domainMatch in interface CookieSpec
Parameters:
host - ignored
domain - ignored
Returns:
false

pathMatch

public boolean pathMatch(String path,
                         String topmostPath)
Description copied from interface: CookieSpec
Performs path-match as defined by the cookie specification.

Specified by:
pathMatch in interface CookieSpec
Parameters:
path - ignored
topmostPath - ignored
Returns:
false


Copyright (c) 1999-2005 - Apache Software Foundation