1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 package org.apache.commons.httpclient.cookie;
31
32 import java.util.Collection;
33
34 import org.apache.commons.httpclient.Cookie;
35 import org.apache.commons.httpclient.Header;
36 import org.apache.commons.httpclient.NameValuePair;
37
38 /***
39 * A cookie spec that does nothing. Cookies are neither parsed, formatted nor matched.
40 *
41 * @since 3.0
42 */
43 public class IgnoreCookiesSpec implements CookieSpec {
44
45 /***
46 *
47 */
48 public IgnoreCookiesSpec() {
49 super();
50 }
51
52 /***
53 * Returns an empty {@link Cookie cookie} array. All parameters are ignored.
54 */
55 public Cookie[] parse(String host, int port, String path, boolean secure, String header)
56 throws MalformedCookieException {
57 return new Cookie[0];
58 }
59
60 /***
61 * @return <code>null</code>
62 */
63 public Collection getValidDateFormats() {
64 return null;
65 }
66
67 /***
68 * Does nothing.
69 */
70 public void setValidDateFormats(Collection datepatterns) {
71 }
72
73 /***
74 * @return <code>null</code>
75 */
76 public String formatCookie(Cookie cookie) {
77 return null;
78 }
79
80 /***
81 * @return <code>null</code>
82 */
83 public Header formatCookieHeader(Cookie cookie) throws IllegalArgumentException {
84 return null;
85 }
86
87 /***
88 * @return <code>null</code>
89 */
90 public Header formatCookieHeader(Cookie[] cookies) throws IllegalArgumentException {
91 return null;
92 }
93
94 /***
95 * @return <code>null</code>
96 */
97 public String formatCookies(Cookie[] cookies) throws IllegalArgumentException {
98 return null;
99 }
100
101 /***
102 * @return <code>false</code>
103 */
104 public boolean match(String host, int port, String path, boolean secure, Cookie cookie) {
105 return false;
106 }
107
108 /***
109 * Returns an empty {@link Cookie cookie} array. All parameters are ignored.
110 */
111 public Cookie[] match(String host, int port, String path, boolean secure, Cookie[] cookies) {
112 return new Cookie[0];
113 }
114
115 /***
116 * Returns an empty {@link Cookie cookie} array. All parameters are ignored.
117 */
118 public Cookie[] parse(String host, int port, String path, boolean secure, Header header)
119 throws MalformedCookieException, IllegalArgumentException {
120 return new Cookie[0];
121 }
122
123 /***
124 * Does nothing.
125 */
126 public void parseAttribute(NameValuePair attribute, Cookie cookie)
127 throws MalformedCookieException, IllegalArgumentException {
128 }
129
130 /***
131 * Does nothing.
132 */
133 public void validate(String host, int port, String path, boolean secure, Cookie cookie)
134 throws MalformedCookieException, IllegalArgumentException {
135 }
136
137 /***
138 * @return <code>false</code>
139 */
140 public boolean domainMatch(final String host, final String domain) {
141 return false;
142 }
143
144 /***
145 * @return <code>false</code>
146 */
147 public boolean pathMatch(final String path, final String topmostPath) {
148 return false;
149 }
150
151 }