net.sf.dc.http
Class HttpConnection

java.lang.Object
  extended by net.sf.dc.http.HttpConnection

public class HttpConnection
extends java.lang.Object

HttpURLConnection implementation with proxy implementation

Since:
1.4
Version:
1.9
Author:
Robert Jan van der Waals

Constructor Summary
HttpConnection(java.net.URL url)
           
 
Method Summary
 void close()
           
 byte[] getBytes()
          Read the bytes from the given location to a String.
 int getContentLength()
           
 java.lang.String getImageAsBase64()
          Retrieves a picture from the net and returns this as a BASE64 string
 java.io.OutputStream getOutputStream()
           
 java.lang.String getString(java.net.URL url)
          Read the page from the given location to a String
 void setContentLength(int length)
           
 void setToSoapRequest(java.lang.String soapAction)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpConnection

public HttpConnection(java.net.URL url)
               throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

getString

public java.lang.String getString(java.net.URL url)
                           throws java.io.IOException
Read the page from the given location to a String

Parameters:
url - the target
Throws:
java.io.IOException

getContentLength

public int getContentLength()

setContentLength

public void setContentLength(int length)

setToSoapRequest

public void setToSoapRequest(java.lang.String soapAction)
                      throws java.lang.Exception
Throws:
java.lang.Exception

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
Throws:
java.io.IOException

getBytes

public final byte[] getBytes()
                      throws java.io.IOException
Read the bytes from the given location to a String. Used for images.

Parameters:
url - the target
Throws:
java.io.IOException

getImageAsBase64

public final java.lang.String getImageAsBase64()
                                        throws java.io.IOException
Retrieves a picture from the net and returns this as a BASE64 string

Parameters:
url - target url
Throws:
java.io.IOException

close

public void close()