KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > commons > httpclient > NoncompliantHeadMethod


1 /*
2  * ====================================================================
3  *
4  * Copyright 2003-2004 The Apache Software Foundation
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  * ====================================================================
18  *
19  * This software consists of voluntary contributions made by many
20  * individuals on behalf of the Apache Software Foundation. For more
21  * information on the Apache Software Foundation, please see
22  * <http://www.apache.org/>.
23  *
24  * [Additional notices, if required by prior licensing conditions]
25  *
26  */

27 package org.apache.commons.httpclient;
28
29 import org.apache.commons.httpclient.methods.HeadMethod;
30
31 /**
32  * HTTP GET methid intended to simulate side-effects of
33  * interaction with non-compiant HTTP servers or proxies
34  *
35  * @author Oleg Kalnichevski
36  */

37
38 public class NoncompliantHeadMethod extends HeadMethod {
39
40     public NoncompliantHeadMethod(){
41         super();
42     }
43
44     public NoncompliantHeadMethod(String JavaDoc uri) {
45         super(uri);
46     }
47
48     /**
49      * Expect HTTP HEAD but perform HTTP GET instead in order to
50      * simulate the behaviour of a non-compliant HTTP server sending
51      * body content in response to HTTP HEAD request
52      *
53      */

54     public String JavaDoc getName() {
55         return "GET";
56     }
57
58 }
59
Popular Tags