Save This Page
Home » cactus-1.8.0-src » org.apache.cactus.internal.client.connector.http » [javadoc | source]
org.apache.cactus.internal.client.connector.http
final class: AutoReadHttpURLConnection [javadoc | source]
java.lang.Object
   java.net.URLConnection
      java.net.HttpURLConnection
         org.apache.cactus.internal.client.connector.http.AutoReadHttpURLConnection
Wrapper class for the real HttpURLConnection to the test servlet that reads the complete input stream into an internal buffer on the first call to getInputStream(). This is to ensure that the test servlet is not blocked on i/o when the test caller asks for the results.

The wrapper returns the buffered input stream from getInputStream and delegates the rest of the calls.

This class is final so we don't have to provide access to protected instance variables and methods of the wrapped connection.

Fields inherited from java.net.HttpURLConnection:
HTTP_OK,  HTTP_CREATED,  HTTP_ACCEPTED,  HTTP_NOT_AUTHORITATIVE,  HTTP_NO_CONTENT,  HTTP_RESET,  HTTP_PARTIAL,  HTTP_MULT_CHOICE,  HTTP_MOVED_PERM,  HTTP_MOVED_TEMP,  HTTP_SEE_OTHER,  HTTP_NOT_MODIFIED,  HTTP_USE_PROXY,  HTTP_BAD_REQUEST,  HTTP_UNAUTHORIZED,  HTTP_PAYMENT_REQUIRED,  HTTP_FORBIDDEN,  HTTP_NOT_FOUND,  HTTP_BAD_METHOD,  HTTP_NOT_ACCEPTABLE,  HTTP_PROXY_AUTH,  HTTP_CLIENT_TIMEOUT,  HTTP_CONFLICT,  HTTP_GONE,  HTTP_LENGTH_REQUIRED,  HTTP_PRECON_FAILED,  HTTP_ENTITY_TOO_LARGE,  HTTP_REQ_TOO_LONG,  HTTP_UNSUPPORTED_TYPE,  HTTP_SERVER_ERROR,  HTTP_INTERNAL_ERROR,  HTTP_NOT_IMPLEMENTED,  HTTP_BAD_GATEWAY,  HTTP_UNAVAILABLE,  HTTP_GATEWAY_TIMEOUT,  HTTP_VERSION
Constructor:
 AutoReadHttpURLConnection(HttpURLConnection theConnection) 
    Constructs a an AutoReadHttpURLConnection object from an HttpURLConnection.
    Parameters:
    theConnection - the original connection to wrap
Method from org.apache.cactus.internal.client.connector.http.AutoReadHttpURLConnection Summary:
connect,   disconnect,   getAllowUserInteraction,   getContent,   getContentEncoding,   getContentLength,   getContentType,   getDate,   getDefaultUseCaches,   getDoInput,   getDoOutput,   getErrorStream,   getExpiration,   getHeaderField,   getHeaderField,   getHeaderFieldDate,   getHeaderFieldInt,   getHeaderFieldKey,   getIfModifiedSince,   getInputStream,   getLastModified,   getOutputStream,   getPermission,   getRequestMethod,   getRequestProperty,   getResponseCode,   getResponseMessage,   getURL,   getUseCaches,   setAllowUserInteraction,   setDefaultUseCaches,   setDoInput,   setDoOutput,   setIfModifiedSince,   setRequestMethod,   setRequestProperty,   setUseCaches,   toString,   usingProxy
Methods from java.net.HttpURLConnection:
disconnect,   getErrorStream,   getFollowRedirects,   getHeaderField,   getHeaderFieldDate,   getHeaderFieldKey,   getInstanceFollowRedirects,   getPermission,   getRequestMethod,   getResponseCode,   getResponseMessage,   setChunkedStreamingMode,   setFixedLengthStreamingMode,   setFollowRedirects,   setInstanceFollowRedirects,   setRequestMethod,   usingProxy
Methods from java.net.URLConnection:
addRequestProperty,   connect,   getAllowUserInteraction,   getConnectTimeout,   getContent,   getContent,   getContentEncoding,   getContentLength,   getContentType,   getDate,   getDefaultAllowUserInteraction,   getDefaultRequestProperty,   getDefaultUseCaches,   getDoInput,   getDoOutput,   getExpiration,   getFileNameMap,   getHeaderField,   getHeaderField,   getHeaderFieldDate,   getHeaderFieldInt,   getHeaderFieldKey,   getHeaderFields,   getIfModifiedSince,   getInputStream,   getLastModified,   getOutputStream,   getPermission,   getReadTimeout,   getRequestProperties,   getRequestProperty,   getURL,   getUseCaches,   guessContentTypeFromName,   guessContentTypeFromStream,   setAllowUserInteraction,   setConnectTimeout,   setContentHandlerFactory,   setDefaultAllowUserInteraction,   setDefaultRequestProperty,   setDefaultUseCaches,   setDoInput,   setDoOutput,   setFileNameMap,   setIfModifiedSince,   setReadTimeout,   setRequestProperty,   setUseCaches,   toString
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.cactus.internal.client.connector.http.AutoReadHttpURLConnection Detail:
 public  void connect() throws IOException 
    {@inheritDoc}
 public  void disconnect() 
    {@inheritDoc}
 public boolean getAllowUserInteraction() 
    {@inheritDoc}
 public Object getContent() throws IOException 
    {@inheritDoc}
 public String getContentEncoding() 
    {@inheritDoc}
 public int getContentLength() 
    {@inheritDoc}
 public String getContentType() 
    {@inheritDoc}
 public long getDate() 
    {@inheritDoc}
 public boolean getDefaultUseCaches() 
    {@inheritDoc}
 public boolean getDoInput() 
    {@inheritDoc}
 public boolean getDoOutput() 
    {@inheritDoc}
 public InputStream getErrorStream() 
    {@inheritDoc}
 public long getExpiration() 
    {@inheritDoc}
 public String getHeaderField(int thePosition) 
    {@inheritDoc}
 public String getHeaderField(String theName) 
    {@inheritDoc}
 public long getHeaderFieldDate(String theName,
    long theDefaultValue) 
    {@inheritDoc}
 public int getHeaderFieldInt(String theName,
    int theDefaultValue) 
    {@inheritDoc}
 public String getHeaderFieldKey(int thePosition) 
    {@inheritDoc}
 public long getIfModifiedSince() 
    {@inheritDoc}
 public synchronized InputStream getInputStream() throws IOException 
    Returns an input stream containing the fully read contents of the wrapped connection's input stream.
 public long getLastModified() 
    {@inheritDoc}
 public OutputStream getOutputStream() throws IOException 
    {@inheritDoc}
 public Permission getPermission() throws IOException 
    {@inheritDoc}
 public String getRequestMethod() 
    {@inheritDoc}
 public String getRequestProperty(String theKey) 
    {@inheritDoc}
 public int getResponseCode() throws IOException 
    {@inheritDoc}
 public String getResponseMessage() throws IOException 
    {@inheritDoc}
 public URL getURL() 
    {@inheritDoc}
 public boolean getUseCaches() 
    {@inheritDoc}
 public  void setAllowUserInteraction(boolean hasInteraction) 
    {@inheritDoc}
 public  void setDefaultUseCaches(boolean isUsingDefaultCache) 
    {@inheritDoc}
 public  void setDoInput(boolean isInput) 
    {@inheritDoc}
 public  void setDoOutput(boolean isOutput) 
    {@inheritDoc}
 public  void setIfModifiedSince(long isModifiedSince) 
    {@inheritDoc}
 public  void setRequestMethod(String theMethod) throws ProtocolException 
    {@inheritDoc}
 public  void setRequestProperty(String theKey,
    String theValue) 
    {@inheritDoc}
 public  void setUseCaches(boolean isUsingCaches) 
    {@inheritDoc}
 public String toString() 
    {@inheritDoc}
 public boolean usingProxy() 
    {@inheritDoc}