net.sf.dc.http
Class HttpConnection

java.lang.Object
  extended bynet.sf.dc.http.HttpConnection

public class HttpConnection
extends java.lang.Object

HttpURLConnection implementation. Proxy is implemented

Since:
1.3
Version:
DC1.00
Author:
Robert-Jan van der Waals

Constructor Summary
HttpConnection()
           
 
Method Summary
static byte[] getBytes(java.net.URL url)
          Read the bytes from the given location to a String.
static java.lang.String getImageAsBase64(java.net.URL url)
          Retrieves a picture from the net and returns this as a BASE64 string
static java.lang.String getString(java.net.URL url)
          Read the page from the given location to a String
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpConnection

public HttpConnection()
Method Detail

getString

public static final 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

getBytes

public static final byte[] getBytes(java.net.URL url)
                             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 static final java.lang.String getImageAsBase64(java.net.URL url)
                                               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

main

public static void main(java.lang.String[] args)