net.jini.url.httpmd
Class DelegatingHttpURLConnection

java.lang.Object
  extended by java.net.URLConnection
      extended by java.net.HttpURLConnection
          extended by net.jini.url.httpmd.DelegatingHttpURLConnection
Direct Known Subclasses:
HttpmdURLConnection

 class DelegatingHttpURLConnection
extends HttpURLConnection

An HTTP URL connection that delegates all operations defined by HttpURLConnection and URLConnection.

Author:
Sun Microsystems, Inc.

Field Summary
(package private)  HttpURLConnection delegateConnection
          The HTTP URL connection to which operations should be delegated.
 
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
DelegatingHttpURLConnection(URL url)
          Creates an HttpURLConnection for the specified URL that delegates all operations to the value of the delegateConnection field, which should be set separately.
 
Method Summary
 void addRequestProperty(String key, String value)
           
 void connect()
           
 void disconnect()
           
 boolean getAllowUserInteraction()
           
 Object getContent()
           
 Object getContent(Class[] classes)
           
 String getContentEncoding()
           
 int getContentLength()
           
 String getContentType()
           
 long getDate()
           
 boolean getDefaultUseCaches()
           
 boolean getDoInput()
           
 boolean getDoOutput()
           
 InputStream getErrorStream()
           
 long getExpiration()
           
 String getHeaderField(int n)
           
 String getHeaderField(String name)
           
 long getHeaderFieldDate(String name, long Default)
           
 int getHeaderFieldInt(String name, int Default)
           
 String getHeaderFieldKey(int n)
           
 Map getHeaderFields()
           
 long getIfModifiedSince()
           
 InputStream getInputStream()
           
 boolean getInstanceFollowRedirects()
           
 long getLastModified()
           
 OutputStream getOutputStream()
           
 Permission getPermission()
           
 String getRequestMethod()
           
 Map getRequestProperties()
           
 String getRequestProperty(String key)
           
 int getResponseCode()
           
 String getResponseMessage()
           
 URL getURL()
           
 boolean getUseCaches()
           
 void setAllowUserInteraction(boolean allowuserinteraction)
           
 void setDefaultUseCaches(boolean defaultusecaches)
           
 void setDoInput(boolean doinput)
           
 void setDoOutput(boolean dooutput)
           
 void setIfModifiedSince(long ifmodifiedsince)
           
 void setInstanceFollowRedirects(boolean followRedirects)
           
 void setRequestMethod(String method)
           
 void setRequestProperty(String key, String value)
           
 void setUseCaches(boolean usecaches)
           
 boolean usingProxy()
           
 
Methods inherited from class java.net.HttpURLConnection
getFollowRedirects, setChunkedStreamingMode, setFixedLengthStreamingMode, setFollowRedirects
 
Methods inherited from class java.net.URLConnection
getConnectTimeout, getDefaultAllowUserInteraction, getDefaultRequestProperty, getFileNameMap, getReadTimeout, guessContentTypeFromName, guessContentTypeFromStream, setConnectTimeout, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setFileNameMap, setReadTimeout, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

delegateConnection

HttpURLConnection delegateConnection
The HTTP URL connection to which operations should be delegated.

Constructor Detail

DelegatingHttpURLConnection

DelegatingHttpURLConnection(URL url)
Creates an HttpURLConnection for the specified URL that delegates all operations to the value of the delegateConnection field, which should be set separately.

Method Detail

setInstanceFollowRedirects

public void setInstanceFollowRedirects(boolean followRedirects)
Overrides:
setInstanceFollowRedirects in class HttpURLConnection

getInstanceFollowRedirects

public boolean getInstanceFollowRedirects()
Overrides:
getInstanceFollowRedirects in class HttpURLConnection

setRequestMethod

public void setRequestMethod(String method)
                      throws ProtocolException
Overrides:
setRequestMethod in class HttpURLConnection
Throws:
ProtocolException

getRequestMethod

public String getRequestMethod()
Overrides:
getRequestMethod in class HttpURLConnection

getResponseCode

public int getResponseCode()
                    throws IOException
Overrides:
getResponseCode in class HttpURLConnection
Throws:
IOException

getResponseMessage

public String getResponseMessage()
                          throws IOException
Overrides:
getResponseMessage in class HttpURLConnection
Throws:
IOException

disconnect

public void disconnect()
Specified by:
disconnect in class HttpURLConnection

usingProxy

public boolean usingProxy()
Specified by:
usingProxy in class HttpURLConnection

getErrorStream

public InputStream getErrorStream()
Overrides:
getErrorStream in class HttpURLConnection

connect

public void connect()
             throws IOException
Specified by:
connect in class URLConnection
Throws:
IOException

getURL

public URL getURL()
Overrides:
getURL in class URLConnection

getContentLength

public int getContentLength()
Overrides:
getContentLength in class URLConnection

getContentType

public String getContentType()
Overrides:
getContentType in class URLConnection

getContentEncoding

public String getContentEncoding()
Overrides:
getContentEncoding in class URLConnection

getExpiration

public long getExpiration()
Overrides:
getExpiration in class URLConnection

getDate

public long getDate()
Overrides:
getDate in class URLConnection

getLastModified

public long getLastModified()
Overrides:
getLastModified in class URLConnection

getHeaderField

public String getHeaderField(String name)
Overrides:
getHeaderField in class URLConnection

getHeaderFields

public Map getHeaderFields()
Overrides:
getHeaderFields in class URLConnection

getHeaderFieldInt

public int getHeaderFieldInt(String name,
                             int Default)
Overrides:
getHeaderFieldInt in class URLConnection

getHeaderFieldDate

public long getHeaderFieldDate(String name,
                               long Default)
Overrides:
getHeaderFieldDate in class HttpURLConnection

getHeaderFieldKey

public String getHeaderFieldKey(int n)
Overrides:
getHeaderFieldKey in class HttpURLConnection

getHeaderField

public String getHeaderField(int n)
Overrides:
getHeaderField in class HttpURLConnection

getContent

public Object getContent()
                  throws IOException
Overrides:
getContent in class URLConnection
Throws:
IOException

getContent

public Object getContent(Class[] classes)
                  throws IOException
Overrides:
getContent in class URLConnection
Throws:
IOException

getPermission

public Permission getPermission()
                         throws IOException
Overrides:
getPermission in class HttpURLConnection
Throws:
IOException

getInputStream

public InputStream getInputStream()
                           throws IOException
Overrides:
getInputStream in class URLConnection
Throws:
IOException

getOutputStream

public OutputStream getOutputStream()
                             throws IOException
Overrides:
getOutputStream in class URLConnection
Throws:
IOException

setDoInput

public void setDoInput(boolean doinput)
Overrides:
setDoInput in class URLConnection

getDoInput

public boolean getDoInput()
Overrides:
getDoInput in class URLConnection

setDoOutput

public void setDoOutput(boolean dooutput)
Overrides:
setDoOutput in class URLConnection

getDoOutput

public boolean getDoOutput()
Overrides:
getDoOutput in class URLConnection

setAllowUserInteraction

public void setAllowUserInteraction(boolean allowuserinteraction)
Overrides:
setAllowUserInteraction in class URLConnection

getAllowUserInteraction

public boolean getAllowUserInteraction()
Overrides:
getAllowUserInteraction in class URLConnection

setUseCaches

public void setUseCaches(boolean usecaches)
Overrides:
setUseCaches in class URLConnection

getUseCaches

public boolean getUseCaches()
Overrides:
getUseCaches in class URLConnection

setIfModifiedSince

public void setIfModifiedSince(long ifmodifiedsince)
Overrides:
setIfModifiedSince in class URLConnection

getIfModifiedSince

public long getIfModifiedSince()
Overrides:
getIfModifiedSince in class URLConnection

getDefaultUseCaches

public boolean getDefaultUseCaches()
Overrides:
getDefaultUseCaches in class URLConnection

setDefaultUseCaches

public void setDefaultUseCaches(boolean defaultusecaches)
Overrides:
setDefaultUseCaches in class URLConnection

setRequestProperty

public void setRequestProperty(String key,
                               String value)
Overrides:
setRequestProperty in class URLConnection

addRequestProperty

public void addRequestProperty(String key,
                               String value)
Overrides:
addRequestProperty in class URLConnection

getRequestProperty

public String getRequestProperty(String key)
Overrides:
getRequestProperty in class URLConnection

getRequestProperties

public Map getRequestProperties()
Overrides:
getRequestProperties in class URLConnection


Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.