BEA Systems, Inc.

BEA WebLogic Server 9.1 API Reference


weblogic.net.http
Class HttpURLConnection

java.lang.Object
  extended byjava.net.URLConnection
      extended byjava.net.HttpURLConnection
          extended byweblogic.net.http.HttpURLConnection
Direct Known Subclasses:
HttpsURLConnection, SOAPHttpURLConnection

public class HttpURLConnection
extends HttpURLConnection

A class to represent an HTTP connection to a remote object.

Copyright © 2005 BEA Systems, Inc. All Rights Reserved.

Field Summary
protected static int defaultConnectTimeout
           
 
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, method, responseCode, responseMessage
 
Fields inherited from class java.net.URLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
 
Constructor Summary
HttpURLConnection(URL u)
           
 
Method Summary
 void addRequestProperty(String key, String value)
          Adds a general request property specified by a key-value pair.
 void connect()
           
 void disconnect()
          Disconnect from the server.
protected  void doSetRequests()
           
protected  boolean followRedirect()
           
static String getAuthInfo(String host, int port, String header)
           
 int getConnectTimeout()
           
 InputStream getErrorStream()
           
 String getHeaderField(int n)
          Gets a header field by index.
 String getHeaderField(String name)
          Gets a header field by name.
 String getHeaderFieldKey(int n)
          Gets a header field by index.
 Map getHeaderFields()
          Gets all header fields.
protected  weblogic.net.http.HttpClient getHttpClient()
           
 InputStream getInputStream()
           
 OutputStream getOutputStream()
           
protected  String getProtocol()
           
protected static String getProxyAuthString()
           
 int getReadTimeout()
           
 Map getRequestProperties()
           
 String getRequestProperty(String key)
           
 int getResponseCode()
           
 SocketFactory getSocketFactory()
          Gets the SocketFactory to be used when creating sockets for http URL connections.
 int getTimeout()
          Deprecated. since 9.0. Use getReadTimeout() instead
 void setChunkedStreamingMode(int chunkLength)
           
 void setConnectTimeout(int i)
           
 void setEmptyRequestProperty(String key)
           
 void setFixedLengthStreamingMode(int fixedContentLength)
           
 void setMuxableSocket(Object socket)
           
 void setReadTimeout(int i)
           
 void setRequestProperty(String key, String value)
           
 void setSocketFactory(SocketFactory fact)
          Sets the SocketFactory to be used when creating sockets for http URL connections.
 void setTimeout(int i)
          Deprecated. since 9.0. Use setReadTimeout(int) instead
 boolean usingProxy()
           
protected  void writeRequests()
           
 
Methods inherited from class java.net.HttpURLConnection
getFollowRedirects, getHeaderFieldDate, getInstanceFollowRedirects, getPermission, getRequestMethod, getResponseMessage, setFollowRedirects, setInstanceFollowRedirects, setRequestMethod
 
Methods inherited from class java.net.URLConnection
getAllowUserInteraction, getContent, getContent, getContentEncoding, getContentLength, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderFieldInt, getIfModifiedSince, getLastModified, getURL, getUseCaches, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setUseCaches, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

defaultConnectTimeout

protected static int defaultConnectTimeout
Constructor Detail

HttpURLConnection

public HttpURLConnection(URL u)
Method Detail

addRequestProperty

public void addRequestProperty(String key,
                               String value)
Adds a general request property specified by a key-value pair. This method will not overwrite existing values associated with the same key.

Parameters:
key - - request header name
value - - request header value

connect

public void connect()
             throws IOException
Throws:
IOException

disconnect

public void disconnect()
Disconnect from the server.


doSetRequests

protected void doSetRequests()

followRedirect

protected boolean followRedirect()
                          throws IOException
Throws:
IOException

getAuthInfo

public static String getAuthInfo(String host,
                                 int port,
                                 String header)
                          throws IOException
Throws:
IOException

getConnectTimeout

public int getConnectTimeout()

getErrorStream

public InputStream getErrorStream()

getHeaderField

public String getHeaderField(int n)
Gets a header field by index. Returns null if not known.

Parameters:
n - the index of the header field

getHeaderField

public String getHeaderField(String name)
Gets a header field by name. Returns null if not known.

Parameters:
name - the name of the header field

getHeaderFieldKey

public String getHeaderFieldKey(int n)
Gets a header field by index. Returns null if not known.

Parameters:
n - the index of the header field

getHeaderFields

public Map getHeaderFields()
Gets all header fields.


getHttpClient

protected weblogic.net.http.HttpClient getHttpClient()
                                              throws IOException
Throws:
IOException

getInputStream

public InputStream getInputStream()
                           throws IOException
Throws:
IOException

getOutputStream

public OutputStream getOutputStream()
                             throws IOException
Throws:
IOException

getProtocol

protected String getProtocol()

getProxyAuthString

protected static String getProxyAuthString()

getReadTimeout

public int getReadTimeout()

getRequestProperties

public Map getRequestProperties()
Returns:
a Map of the general request properties for this connection.

getRequestProperty

public String getRequestProperty(String key)

getResponseCode

public int getResponseCode()
                    throws IOException
Throws:
IOException

getSocketFactory

public final SocketFactory getSocketFactory()
Gets the SocketFactory to be used when creating sockets for http URL connections.


getTimeout

public int getTimeout()
Deprecated. since 9.0. Use getReadTimeout() instead

Get the read timeout value for this connection

Returns:
the timeout value in milliseconds

setChunkedStreamingMode

public void setChunkedStreamingMode(int chunkLength)

setConnectTimeout

public void setConnectTimeout(int i)

setEmptyRequestProperty

public void setEmptyRequestProperty(String key)

setFixedLengthStreamingMode

public void setFixedLengthStreamingMode(int fixedContentLength)

setMuxableSocket

public void setMuxableSocket(Object socket)

setReadTimeout

public void setReadTimeout(int i)

setRequestProperty

public void setRequestProperty(String key,
                               String value)

setSocketFactory

public final void setSocketFactory(SocketFactory fact)
Sets the SocketFactory to be used when creating sockets for http URL connections.


setTimeout

public void setTimeout(int i)
Deprecated. since 9.0. Use setReadTimeout(int) instead

Sets the read timeout on this connection.

Parameters:
i - in milliseconds

usingProxy

public boolean usingProxy()

writeRequests

protected void writeRequests()
                      throws IOException
Throws:
IOException

Documentation is available at
http://download.oracle.com/docs/cd/E13222_01/wls/docs91
Copyright 2005 BEA Systems Inc.