01: package com.meterware.httpunit;
02:
03: import java.net.URL;
04:
05: /********************************************************************************************************************
06: * $Id: HeadMethodWebRequest.java,v 1.1 2002/10/31 00:25:45 russgold Exp $
07: *
08: * Copyright (c) 2002, Russell Gold
09: *
10: * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
11: * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
12: * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
13: * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
14: *
15: * The above copyright notice and this permission notice shall be included in all copies or substantial portions
16: * of the Software.
17: *
18: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
19: * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
21: * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22: * DEALINGS IN THE SOFTWARE.
23: *
24: *******************************************************************************************************************/
25:
26: /**
27: * A web request using the HEAD method. This request is used to obtain header information for a resource
28: * without necessarily waiting for the data to be computed or transmitted.
29: *
30: * @author <a href="mailto:russgold@httpunit.org">Russell Gold</a>
31: **/
32: public class HeadMethodWebRequest extends HeaderOnlyWebRequest {
33:
34: /**
35: * Creates a new head request from a complete URL string.
36: * @param urlString the URL desired, including the protocol.
37: */
38: public HeadMethodWebRequest(String urlString) {
39: super (urlString);
40: }
41:
42: /**
43: * Creates a new head request using a relative URL and base.
44: * @param urlBase the base URL.
45: * @param urlString the relative URL
46: */
47: public HeadMethodWebRequest(URL urlBase, String urlString) {
48: super (urlBase, urlString);
49: }
50:
51: public String getMethod() {
52: return "HEAD";
53: }
54: }
|