001: /*
002: * $Header: $
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.methods;
032:
033: import org.apache.commons.httpclient.HttpMethodBase;
034:
035: /**
036: * Implements the HTTP TRACE method.
037: * <p>
038: * The HTTP TRACE method is defined in section 9.6 of
039: * <a href="http://www.ietf.org/rfc/rfc2616.txt">RFC2616</a>:
040: * <blockquote>
041: * The TRACE method is used to invoke a remote, application-layer loop-
042: * back of the request message. The final recipient of the request
043: * SHOULD reflect the message received back to the client as the
044: * entity-body of a 200 (OK) response. The final recipient is either the
045: * origin server or the first proxy or gateway to receive a Max-Forwards
046: * value of zero (0) in the request (see section 14.31). A TRACE request
047: * MUST NOT include an entity.
048: * </blockquote>
049: * </p>
050: *
051: * @author Sean C. Sullivan
052: * @author <a href="mailto:mbowler@GargoyleSoftware.com">Mike Bowler</a>
053: * @author <a href="mailto:jsdever@apache.org">Jeff Dever</a>
054: *
055: * @version $Revision: 480424 $
056: * @since 2.0
057: *
058: */
059: public class TraceMethod extends HttpMethodBase {
060:
061: //~ Constructors
062:
063: /**
064: * Constructor specifying a URI.
065: *
066: * @param uri either an absolute or relative URI
067: *
068: * @since 2.0
069: *
070: */
071: public TraceMethod(String uri) {
072: super (uri);
073: setFollowRedirects(false);
074: }
075:
076: //~ Methods
077:
078: /**
079: * Returns <tt>"TRACE"</tt>.
080: *
081: * @return <tt>"TRACE"</tt>
082: *
083: * @since 2.0
084: *
085: */
086: public String getName() {
087: return "TRACE";
088: }
089:
090: /**
091: * Recycles the HTTP method so that it can be used again.
092: * Note that all of the instance variables will be reset
093: * once this method has been called. This method will also
094: * release the connection being used by this HTTP method.
095: *
096: * @see #releaseConnection()
097: *
098: * @since 2.0
099: *
100: * @deprecated no longer supported and will be removed in the future
101: * version of HttpClient
102: */
103: public void recycle() {
104: super .recycle();
105: setFollowRedirects(false);
106: }
107:
108: }
|