001: /*
002: * $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 $
003: * $Revision: 480424 $
004: * $Date: 2006-11-29 06:56:49 +0100 (Wed, 29 Nov 2006) $
005: *
006: * ====================================================================
007: *
008: * Licensed to the Apache Software Foundation (ASF) under one or more
009: * contributor license agreements. See the NOTICE file distributed with
010: * this work for additional information regarding copyright ownership.
011: * The ASF licenses this file to You under the Apache License, Version 2.0
012: * (the "License"); you may not use this file except in compliance with
013: * the License. You may obtain a copy of the License at
014: *
015: * http://www.apache.org/licenses/LICENSE-2.0
016: *
017: * Unless required by applicable law or agreed to in writing, software
018: * distributed under the License is distributed on an "AS IS" BASIS,
019: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
020: * See the License for the specific language governing permissions and
021: * limitations under the License.
022: * ====================================================================
023: *
024: * This software consists of voluntary contributions made by many
025: * individuals on behalf of the Apache Software Foundation. For more
026: * information on the Apache Software Foundation, please see
027: * <http://www.apache.org/>.
028: *
029: */
030:
031: package org.apache.commons.httpclient.cookie;
032:
033: import java.util.Collection;
034:
035: import org.apache.commons.httpclient.Cookie;
036: import org.apache.commons.httpclient.Header;
037: import org.apache.commons.httpclient.NameValuePair;
038:
039: /**
040: * A cookie spec that does nothing. Cookies are neither parsed, formatted nor matched.
041: * It can be used to effectively disable cookies altogether.
042: *
043: * @since 3.0
044: */
045: public class IgnoreCookiesSpec implements CookieSpec {
046:
047: /**
048: *
049: */
050: public IgnoreCookiesSpec() {
051: super ();
052: }
053:
054: /**
055: * Returns an empty {@link Cookie cookie} array. All parameters are ignored.
056: */
057: public Cookie[] parse(String host, int port, String path,
058: boolean secure, String header)
059: throws MalformedCookieException {
060: return new Cookie[0];
061: }
062:
063: /**
064: * @return <code>null</code>
065: */
066: public Collection getValidDateFormats() {
067: return null;
068: }
069:
070: /**
071: * Does nothing.
072: */
073: public void setValidDateFormats(Collection datepatterns) {
074: }
075:
076: /**
077: * @return <code>null</code>
078: */
079: public String formatCookie(Cookie cookie) {
080: return null;
081: }
082:
083: /**
084: * @return <code>null</code>
085: */
086: public Header formatCookieHeader(Cookie cookie)
087: throws IllegalArgumentException {
088: return null;
089: }
090:
091: /**
092: * @return <code>null</code>
093: */
094: public Header formatCookieHeader(Cookie[] cookies)
095: throws IllegalArgumentException {
096: return null;
097: }
098:
099: /**
100: * @return <code>null</code>
101: */
102: public String formatCookies(Cookie[] cookies)
103: throws IllegalArgumentException {
104: return null;
105: }
106:
107: /**
108: * @return <code>false</code>
109: */
110: public boolean match(String host, int port, String path,
111: boolean secure, Cookie cookie) {
112: return false;
113: }
114:
115: /**
116: * Returns an empty {@link Cookie cookie} array. All parameters are ignored.
117: */
118: public Cookie[] match(String host, int port, String path,
119: boolean secure, Cookie[] cookies) {
120: return new Cookie[0];
121: }
122:
123: /**
124: * Returns an empty {@link Cookie cookie} array. All parameters are ignored.
125: */
126: public Cookie[] parse(String host, int port, String path,
127: boolean secure, Header header)
128: throws MalformedCookieException, IllegalArgumentException {
129: return new Cookie[0];
130: }
131:
132: /**
133: * Does nothing.
134: */
135: public void parseAttribute(NameValuePair attribute, Cookie cookie)
136: throws MalformedCookieException, IllegalArgumentException {
137: }
138:
139: /**
140: * Does nothing.
141: */
142: public void validate(String host, int port, String path,
143: boolean secure, Cookie cookie)
144: throws MalformedCookieException, IllegalArgumentException {
145: }
146:
147: /**
148: * @return <code>false</code>
149: */
150: public boolean domainMatch(final String host, final String domain) {
151: return false;
152: }
153:
154: /**
155: * @return <code>false</code>
156: */
157: public boolean pathMatch(final String path, final String topmostPath) {
158: return false;
159: }
160:
161: }
|