org.apache.cactus.util
Class HttpURLConnection

java.lang.Object
  extended byjava.net.URLConnection
      extended byjava.net.HttpURLConnection
          extended byorg.apache.cactus.util.HttpURLConnection

Deprecated. This class has been donated to the Jakarta Commons-HttpClient project, and is now maintained there as org.apache.commons.httpclient.util.HttpURLConnection.

public class HttpURLConnection
extends java.net.HttpURLConnection

Provides a HttpURLConnection wrapper around HttpClient HttpMethod. This allows existing code to easily switch to HttpClieht without breaking existing interfaces using the JDK HttpURLConnection. Note: It is a best try effort as different version of the JDK have different behaviours for HttpURLConnection (And I'm not even including the numerous HttpURLConnection bugs!).

Version:
$Id: HttpURLConnection.java,v 1.6 2003/05/26 11:45:22 cmlenz Exp $
Author:
Vincent Massol

Field Summary
 
Fields inherited from class java.net.HttpURLConnection
HTTP_ACCEPTED, HTTP_BAD_GATEWAY, HTTP_BAD_METHOD, HTTP_BAD_REQUEST, HTTP_CLIENT_TIMEOUT, HTTP_CONFLICT, HTTP_CREATED, HTTP_ENTITY_TOO_LARGE, HTTP_FORBIDDEN, HTTP_GATEWAY_TIMEOUT, HTTP_GONE, HTTP_INTERNAL_ERROR, HTTP_LENGTH_REQUIRED, HTTP_MOVED_PERM, HTTP_MOVED_TEMP, HTTP_MULT_CHOICE, HTTP_NO_CONTENT, HTTP_NOT_ACCEPTABLE, HTTP_NOT_AUTHORITATIVE, HTTP_NOT_FOUND, HTTP_NOT_IMPLEMENTED, HTTP_NOT_MODIFIED, HTTP_OK, HTTP_PARTIAL, HTTP_PAYMENT_REQUIRED, HTTP_PRECON_FAILED, HTTP_PROXY_AUTH, HTTP_REQ_TOO_LONG, HTTP_RESET, HTTP_SEE_OTHER, HTTP_SERVER_ERROR, HTTP_UNAUTHORIZED, HTTP_UNAVAILABLE, HTTP_UNSUPPORTED_TYPE, HTTP_USE_PROXY, HTTP_VERSION, instanceFollowRedirects, responseCode, responseMessage
 
Fields inherited from class java.net.URLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, useCaches
 
Constructor Summary
  HttpURLConnection(org.apache.commons.httpclient.HttpMethod theMethod, java.net.URL theURL)
          Deprecated. Creates an HttpURLConnection from a HttpMethod.
protected HttpURLConnection(java.net.URL theURL)
          Deprecated.  
 
Method Summary
 void connect()
          Deprecated.  
 void disconnect()
          Deprecated.  
 boolean getAllowUserInteraction()
          Deprecated.  
 java.lang.Object getContent()
          Deprecated.  
 java.lang.Object getContent(java.lang.Class[] theClasses)
          Deprecated.  
 boolean getDefaultUseCaches()
          Deprecated.  
 boolean getDoInput()
          Deprecated.  
 boolean getDoOutput()
          Deprecated.  
 java.io.InputStream getErrorStream()
          Deprecated.  
 java.lang.String getHeaderField(int thePosition)
          Deprecated.  
 java.lang.String getHeaderField(java.lang.String theName)
          Deprecated.  
 java.lang.String getHeaderFieldKey(int theKeyPosition)
          Deprecated.  
 long getIfModifiedSince()
          Deprecated.  
 java.io.InputStream getInputStream()
          Deprecated.  
 boolean getInstanceFollowRedirects()
          Deprecated.  
 java.io.OutputStream getOutputStream()
          Deprecated.  
 java.security.Permission getPermission()
          Deprecated.  
 java.lang.String getRequestMethod()
          Deprecated.  
 java.lang.String getRequestProperty(java.lang.String theKey)
          Deprecated.  
 int getResponseCode()
          Deprecated.  
 java.lang.String getResponseMessage()
          Deprecated.  
 java.net.URL getURL()
          Deprecated.  
 boolean getUseCaches()
          Deprecated.  
 void setAllowUserInteraction(boolean isAllowInteraction)
          Deprecated.  
 void setDefaultUseCaches(boolean isUsingCaches)
          Deprecated.  
 void setDoInput(boolean isInput)
          Deprecated.  
 void setDoOutput(boolean isOutput)
          Deprecated.  
 void setIfModifiedSince(long theModificationDate)
          Deprecated.  
 void setInstanceFollowRedirects(boolean isFollowingRedirects)
          Deprecated.  
 void setRequestMethod(java.lang.String theMethod)
          Deprecated.  
 void setRequestProperty(java.lang.String theKey, java.lang.String theValue)
          Deprecated.  
 void setUseCaches(boolean isUsingCaches)
          Deprecated.  
 boolean usingProxy()
          Deprecated.  
 
Methods inherited from class java.net.HttpURLConnection
getFollowRedirects, getHeaderFieldDate, setFollowRedirects
 
Methods inherited from class java.net.URLConnection
addRequestProperty, getContentEncoding, getContentLength, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getExpiration, getFileNameMap, getHeaderFieldInt, getHeaderFields, getLastModified, getRequestProperties, guessContentTypeFromName, guessContentTypeFromStream, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setFileNameMap, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HttpURLConnection

public HttpURLConnection(org.apache.commons.httpclient.HttpMethod theMethod,
                         java.net.URL theURL)
Deprecated. 
Creates an HttpURLConnection from a HttpMethod.

Parameters:
theMethod - the theMethod that was used to connect to the HTTP server and which contains the returned data.
theURL - the URL to which we are connected (includes query string)

HttpURLConnection

protected HttpURLConnection(java.net.URL theURL)
Deprecated. 
See Also:
HttpURLConnection.HttpURLConnection(URL)
Method Detail

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Deprecated. 
Throws:
java.io.IOException
See Also:
URLConnection.getInputStream()

getErrorStream

public java.io.InputStream getErrorStream()
Deprecated. 
See Also:
HttpURLConnection.getErrorStream()

disconnect

public void disconnect()
Deprecated. 
See Also:
HttpURLConnection.disconnect()

connect

public void connect()
             throws java.io.IOException
Deprecated. 
Throws:
java.io.IOException
See Also:
URLConnection.connect()

usingProxy

public boolean usingProxy()
Deprecated. 
See Also:
HttpURLConnection.usingProxy()

getRequestMethod

public java.lang.String getRequestMethod()
Deprecated. 
See Also:
HttpURLConnection.getRequestMethod()

getResponseCode

public int getResponseCode()
                    throws java.io.IOException
Deprecated. 
Throws:
java.io.IOException
See Also:
HttpURLConnection.getResponseCode()

getResponseMessage

public java.lang.String getResponseMessage()
                                    throws java.io.IOException
Deprecated. 
Throws:
java.io.IOException
See Also:
HttpURLConnection.getResponseMessage()

getHeaderField

public java.lang.String getHeaderField(java.lang.String theName)
Deprecated. 
See Also:
URLConnection.getHeaderField(String)

getHeaderFieldKey

public java.lang.String getHeaderFieldKey(int theKeyPosition)
Deprecated. 
See Also:
HttpURLConnection.getHeaderFieldKey(int)

getHeaderField

public java.lang.String getHeaderField(int thePosition)
Deprecated. 
See Also:
HttpURLConnection.getHeaderField(int)

getURL

public java.net.URL getURL()
Deprecated. 
See Also:
URLConnection.getURL()

setInstanceFollowRedirects

public void setInstanceFollowRedirects(boolean isFollowingRedirects)
Deprecated. 
See Also:
HttpURLConnection.setInstanceFollowRedirects(boolean)

getInstanceFollowRedirects

public boolean getInstanceFollowRedirects()
Deprecated. 
See Also:
HttpURLConnection.getInstanceFollowRedirects()

setRequestMethod

public void setRequestMethod(java.lang.String theMethod)
                      throws java.net.ProtocolException
Deprecated. 
Throws:
java.net.ProtocolException
See Also:
HttpURLConnection.setRequestMethod(String)

getPermission

public java.security.Permission getPermission()
                                       throws java.io.IOException
Deprecated. 
Throws:
java.io.IOException
See Also:
HttpURLConnection.getPermission()

getContent

public java.lang.Object getContent()
                            throws java.io.IOException
Deprecated. 
Throws:
java.io.IOException
See Also:
URLConnection.getContent()

getContent

public java.lang.Object getContent(java.lang.Class[] theClasses)
                            throws java.io.IOException
Deprecated. 
Throws:
java.io.IOException
See Also:
URLConnection.getContent(Class[])

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
Deprecated. 
Throws:
java.io.IOException
See Also:
URLConnection.getOutputStream()

setDoInput

public void setDoInput(boolean isInput)
Deprecated. 
See Also:
URLConnection.setDoInput(boolean)

getDoInput

public boolean getDoInput()
Deprecated. 
See Also:
URLConnection.getDoInput()

setDoOutput

public void setDoOutput(boolean isOutput)
Deprecated. 
See Also:
URLConnection.setDoOutput(boolean)

getDoOutput

public boolean getDoOutput()
Deprecated. 
See Also:
URLConnection.getDoOutput()

setAllowUserInteraction

public void setAllowUserInteraction(boolean isAllowInteraction)
Deprecated. 
See Also:
URLConnection.setAllowUserInteraction(boolean)

getAllowUserInteraction

public boolean getAllowUserInteraction()
Deprecated. 
See Also:
URLConnection.getAllowUserInteraction()

setUseCaches

public void setUseCaches(boolean isUsingCaches)
Deprecated. 
See Also:
URLConnection.setUseCaches(boolean)

getUseCaches

public boolean getUseCaches()
Deprecated. 
See Also:
URLConnection.getUseCaches()

setIfModifiedSince

public void setIfModifiedSince(long theModificationDate)
Deprecated. 
See Also:
URLConnection.setIfModifiedSince(long)

getIfModifiedSince

public long getIfModifiedSince()
Deprecated. 
See Also:
URLConnection.getIfModifiedSince()

getDefaultUseCaches

public boolean getDefaultUseCaches()
Deprecated. 
See Also:
URLConnection.getDefaultUseCaches()

setDefaultUseCaches

public void setDefaultUseCaches(boolean isUsingCaches)
Deprecated. 
See Also:
URLConnection.setDefaultUseCaches(boolean)

setRequestProperty

public void setRequestProperty(java.lang.String theKey,
                               java.lang.String theValue)
Deprecated. 
See Also:
URLConnection.setRequestProperty(String, String)

getRequestProperty

public java.lang.String getRequestProperty(java.lang.String theKey)
Deprecated. 
See Also:
URLConnection.getRequestProperty(String)


Copyright © 2000-2003 Apache Software Foundation. All Rights Reserved.