org.apache.commons.httpclient
Class ConnectMethod
java.lang.Object
|
+--org.apache.commons.httpclient.HttpMethodBase
|
+--org.apache.commons.httpclient.ConnectMethod
- All Implemented Interfaces:
- HttpMethod
- public class ConnectMethod
- extends HttpMethodBase
Wraps another method to tunnel through a proxy.
- Since:
- 2.0
- Version:
- $Revision: 1.4 $ $Date: 2002/08/05 12:26:24 $
- Author:
- Ortwin Glück, dIon Gillard
Field Summary |
static java.lang.String |
NAME
the name of this method |
Methods inherited from class org.apache.commons.httpclient.HttpMethodBase |
addAuthorizationRequestHeader, addContentLengthRequestHeader, addCookieRequestHeader, addHostRequestHeader, addProxyAuthorizationRequestHeader, addRequestHeader, addRequestHeader, addRequestHeaders, addResponseFooter, addUserAgentRequestHeader, checkNotUsed, checkUsed, generateRequestLine, getFollowRedirects, getPath, getQueryString, getRequestContentLength, getRequestHeader, getRequestHeaders, getResponseBody, getResponseBodyAsStream, getResponseBodyAsString, getResponseFooter, getResponseFooters, getResponseHeader, getResponseHeaders, getStatusCode, getStatusText, hasBeenUsed, isHttp11, isStrictMode, processResponseBody, processResponseHeaders, processStatusLine, readResponse, readResponseBody, readResponseHeaders, readStatusLine, recycle, removeRequestHeader, setFollowRedirects, setHttp11, setPath, setQueryString, setQueryString, setRequestHeader, setRequestHeader, setResponseStream, setStrictMode, validate, writeRequest, writeRequestBody |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NAME
public static final java.lang.String NAME
- the name of this method
ConnectMethod
public ConnectMethod(HttpMethod method)
- Create a connect method wrapping the existing method
- Parameters:
method
- the method
to execute after connecting
to the server
getName
public java.lang.String getName()
- Provide the
name
of this method.
- Overrides:
getName
in class HttpMethodBase
- Returns:
- the String "CONNECT"
execute
public int execute(HttpState state,
HttpConnection conn)
throws java.io.IOException,
HttpException
- Execute this method by tunnelling and then executing the wrapped method.
- Overrides:
execute
in class HttpMethodBase
- Parameters:
state
- the current http stateconn
- the connection to write to- Returns:
- the http status code from execution
- Throws:
HttpException
- when an error occurs writing the headersjava.io.IOException
- when an error occurs writing the headers
writeRequestHeaders
protected void writeRequestHeaders(HttpState state,
HttpConnection conn)
throws HttpException,
java.io.IOException
- Writes a minimal set of headers to the proxy.
- Overrides:
writeRequestHeaders
in class HttpMethodBase
- Parameters:
state
- the current http stateconn
- the connection to write to- Throws:
HttpException
- when an error occurs writing the headersjava.io.IOException
- when an error occurs writing the headers
writeRequestLine
protected void writeRequestLine(HttpState state,
HttpConnection conn)
throws java.io.IOException,
HttpException
- Special Connect request.
- Overrides:
writeRequestLine
in class HttpMethodBase
- Parameters:
state
- the current http stateconn
- the connection to write to- Throws:
java.io.IOException
- when an error occurs writing the requestHttpException
- when an error occurs writing the request
Copyright (c) 2001 - Apache Software Foundation