2
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//httpclient/src/java/org/apache/commons/httpclient/cookie/IgnoreCookiesSpec.java,v 1.6 2004/09/14 20:11:31 olegk Exp $
4
* $Date: 2005-05-30 08:22:06 -0400 (Mon, 30 May 2005) $
6
* ====================================================================
8
* Copyright 2002-2004 The Apache Software Foundation
10
* Licensed under the Apache License, Version 2.0 (the "License");
11
* you may not use this file except in compliance with the License.
12
* You may obtain a copy of the License at
14
* http://www.apache.org/licenses/LICENSE-2.0
16
* Unless required by applicable law or agreed to in writing, software
17
* distributed under the License is distributed on an "AS IS" BASIS,
18
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
* See the License for the specific language governing permissions and
20
* limitations under the License.
21
* ====================================================================
23
* This software consists of voluntary contributions made by many
24
* individuals on behalf of the Apache Software Foundation. For more
25
* information on the Apache Software Foundation, please see
26
* <http://www.apache.org/>.
30
package org.apache.commons.httpclient.cookie;
32
import java.util.Collection;
34
import org.apache.commons.httpclient.Cookie;
35
import org.apache.commons.httpclient.Header;
36
import org.apache.commons.httpclient.NameValuePair;
39
* A cookie spec that does nothing. Cookies are neither parsed, formatted nor matched.
40
* It can be used to effectively disable cookies altogether.
44
public class IgnoreCookiesSpec implements CookieSpec {
49
public IgnoreCookiesSpec() {
54
* Returns an empty {@link Cookie cookie} array. All parameters are ignored.
56
public Cookie[] parse(String host, int port, String path, boolean secure, String header)
57
throws MalformedCookieException {
62
* @return <code>null</code>
64
public Collection getValidDateFormats() {
71
public void setValidDateFormats(Collection datepatterns) {
75
* @return <code>null</code>
77
public String formatCookie(Cookie cookie) {
82
* @return <code>null</code>
84
public Header formatCookieHeader(Cookie cookie) throws IllegalArgumentException {
89
* @return <code>null</code>
91
public Header formatCookieHeader(Cookie[] cookies) throws IllegalArgumentException {
96
* @return <code>null</code>
98
public String formatCookies(Cookie[] cookies) throws IllegalArgumentException {
103
* @return <code>false</code>
105
public boolean match(String host, int port, String path, boolean secure, Cookie cookie) {
110
* Returns an empty {@link Cookie cookie} array. All parameters are ignored.
112
public Cookie[] match(String host, int port, String path, boolean secure, Cookie[] cookies) {
113
return new Cookie[0];
117
* Returns an empty {@link Cookie cookie} array. All parameters are ignored.
119
public Cookie[] parse(String host, int port, String path, boolean secure, Header header)
120
throws MalformedCookieException, IllegalArgumentException {
121
return new Cookie[0];
127
public void parseAttribute(NameValuePair attribute, Cookie cookie)
128
throws MalformedCookieException, IllegalArgumentException {
134
public void validate(String host, int port, String path, boolean secure, Cookie cookie)
135
throws MalformedCookieException, IllegalArgumentException {
139
* @return <code>false</code>
141
public boolean domainMatch(final String host, final String domain) {
146
* @return <code>false</code>
148
public boolean pathMatch(final String path, final String topmostPath) {