gnu.inet.http
Class HTTPURLConnection

java.lang.Object
  extended by java.net.URLConnection
      extended by java.net.HttpURLConnection
          extended by gnu.inet.http.HTTPURLConnection

public class HTTPURLConnection
extends java.net.HttpURLConnection

A URLConnection that uses the HTTPConnection class.

Author:
Chris Burdess

Field Summary
 
Fields inherited from class java.net.HttpURLConnection
chunkLength, fixedContentLength, 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, method, responseCode, responseMessage
 
Fields inherited from class java.net.URLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
 
Constructor Summary
HTTPURLConnection(java.net.URL url)
          Constructor.
 
Method Summary
 void addRequestProperty(java.lang.String key, java.lang.String value)
           
 void connect()
           
 void disconnect()
           
 java.lang.String getContentType()
           
 java.io.InputStream getErrorStream()
           
 java.lang.String getHeaderField(int index)
           
 java.lang.String getHeaderField(java.lang.String name)
           
 long getHeaderFieldDate(java.lang.String name, long def)
           
 java.lang.String getHeaderFieldKey(int index)
           
 java.util.Map getHeaderFields()
           
 java.io.InputStream getInputStream()
           
 java.io.OutputStream getOutputStream()
           
 java.util.Map getRequestProperties()
           
 java.lang.String getRequestProperty(java.lang.String key)
           
 int getResponseCode()
           
 java.lang.String getResponseMessage()
           
 void setRequestMethod(java.lang.String method)
          Overrides the corresponding method in HttpURLConnection to permit arbitrary methods, as long as they're valid ASCII alphabetic characters.
 void setRequestProperty(java.lang.String key, java.lang.String value)
           
 boolean usingProxy()
           
 
Methods inherited from class java.net.HttpURLConnection
getFollowRedirects, getInstanceFollowRedirects, getPermission, getRequestMethod, setChunkedStreamingMode, setFixedLengthStreamingMode, setFollowRedirects, setInstanceFollowRedirects
 
Methods inherited from class java.net.URLConnection
getAllowUserInteraction, getConnectTimeout, getContent, getContent, getContentEncoding, getContentLength, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderFieldInt, getIfModifiedSince, getLastModified, getReadTimeout, getURL, getUseCaches, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setConnectTimeout, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setReadTimeout, setUseCaches, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HTTPURLConnection

public HTTPURLConnection(java.net.URL url)
Constructor.

Parameters:
url - the URL
Method Detail

connect

public void connect()
             throws java.io.IOException
Specified by:
connect in class java.net.URLConnection
Throws:
java.io.IOException

disconnect

public void disconnect()
Specified by:
disconnect in class java.net.HttpURLConnection

usingProxy

public boolean usingProxy()
Specified by:
usingProxy in class java.net.HttpURLConnection

setRequestMethod

public void setRequestMethod(java.lang.String method)
                      throws java.net.ProtocolException
Overrides the corresponding method in HttpURLConnection to permit arbitrary methods, as long as they're valid ASCII alphabetic characters. This is to permit WebDAV and other HTTP extensions to function.

Overrides:
setRequestMethod in class java.net.HttpURLConnection
Parameters:
method - the method
Throws:
java.net.ProtocolException

getRequestProperty

public java.lang.String getRequestProperty(java.lang.String key)
Overrides:
getRequestProperty in class java.net.URLConnection

getRequestProperties

public java.util.Map getRequestProperties()
Overrides:
getRequestProperties in class java.net.URLConnection

setRequestProperty

public void setRequestProperty(java.lang.String key,
                               java.lang.String value)
Overrides:
setRequestProperty in class java.net.URLConnection

addRequestProperty

public void addRequestProperty(java.lang.String key,
                               java.lang.String value)
Overrides:
addRequestProperty in class java.net.URLConnection

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
Overrides:
getOutputStream in class java.net.URLConnection
Throws:
java.io.IOException

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Overrides:
getInputStream in class java.net.URLConnection
Throws:
java.io.IOException

getErrorStream

public java.io.InputStream getErrorStream()
Overrides:
getErrorStream in class java.net.HttpURLConnection

getHeaderFields

public java.util.Map getHeaderFields()
Overrides:
getHeaderFields in class java.net.URLConnection

getHeaderField

public java.lang.String getHeaderField(int index)
Overrides:
getHeaderField in class java.net.HttpURLConnection

getHeaderFieldKey

public java.lang.String getHeaderFieldKey(int index)
Overrides:
getHeaderFieldKey in class java.net.HttpURLConnection

getHeaderField

public java.lang.String getHeaderField(java.lang.String name)
Overrides:
getHeaderField in class java.net.URLConnection

getHeaderFieldDate

public long getHeaderFieldDate(java.lang.String name,
                               long def)
Overrides:
getHeaderFieldDate in class java.net.HttpURLConnection

getContentType

public java.lang.String getContentType()
Overrides:
getContentType in class java.net.URLConnection

getResponseCode

public int getResponseCode()
                    throws java.io.IOException
Overrides:
getResponseCode in class java.net.HttpURLConnection
Throws:
java.io.IOException

getResponseMessage

public java.lang.String getResponseMessage()
                                    throws java.io.IOException
Overrides:
getResponseMessage in class java.net.HttpURLConnection
Throws:
java.io.IOException


© Copyright 2003 The Free Software Foundation, all rights reserved