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 org.apache.commons.httpclient.Cookie;
33 import org.apache.commons.httpclient.Header;
34 import org.apache.commons.httpclient.NameValuePair;
35
36 /***
37 * A cookie spec that does nothing. Cookies are neither parsed, formatted nor matched.
38 *
39 * @since 3.0
40 */
41 public class IgnoreCookiesSpec implements CookieSpec {
42
43 /***
44 *
45 */
46 public IgnoreCookiesSpec() {
47 super();
48 }
49
50 /***
51 * Returns an empty {@link Cookie cookie} array. All parameters are ignored.
52 */
53 public Cookie[] parse(String host, int port, String path, boolean secure, String header)
54 throws MalformedCookieException {
55 return new Cookie[0];
56 }
57
58 /***
59 * @return <code>null</code>
60 */
61 public String formatCookie(Cookie cookie) {
62 return null;
63 }
64
65 /***
66 * @return <code>null</code>
67 */
68 public Header formatCookieHeader(Cookie cookie) throws IllegalArgumentException {
69 return null;
70 }
71
72 /***
73 * @return <code>null</code>
74 */
75 public Header formatCookieHeader(Cookie[] cookies) throws IllegalArgumentException {
76 return null;
77 }
78
79 /***
80 * @return <code>null</code>
81 */
82 public String formatCookies(Cookie[] cookies) throws IllegalArgumentException {
83 return null;
84 }
85
86 /***
87 * @return <code>false</code>
88 */
89 public boolean match(String host, int port, String path, boolean secure, Cookie cookie) {
90 return false;
91 }
92
93 /***
94 * Returns an empty {@link Cookie cookie} array. All parameters are ignored.
95 */
96 public Cookie[] match(String host, int port, String path, boolean secure, Cookie[] cookies) {
97 return new Cookie[0];
98 }
99
100 /***
101 * Returns an empty {@link Cookie cookie} array. All parameters are ignored.
102 */
103 public Cookie[] parse(String host, int port, String path, boolean secure, Header header)
104 throws MalformedCookieException, IllegalArgumentException {
105 return new Cookie[0];
106 }
107
108 /***
109 * Does nothing.
110 */
111 public void parseAttribute(NameValuePair attribute, Cookie cookie)
112 throws MalformedCookieException, IllegalArgumentException {
113 }
114
115 /***
116 * Does nothing.
117 */
118 public void validate(String host, int port, String path, boolean secure, Cookie cookie)
119 throws MalformedCookieException, IllegalArgumentException {
120 }
121
122 /***
123 * @return <code>false</code>
124 */
125 public boolean domainMatch(final String host, final String domain) {
126 return false;
127 }
128
129 /***
130 * @return <code>false</code>
131 */
132 public boolean pathMatch(final String path, final String topmostPath) {
133 return false;
134 }
135
136 }