net.datacrow.core.http
Class HttpConnectionUtil

java.lang.Object
  extended by net.datacrow.core.http.HttpConnectionUtil

public class HttpConnectionUtil
extends java.lang.Object

Simplification for retrieving data from a specific address.


Constructor Summary
HttpConnectionUtil()
           
 
Method Summary
static HttpConnection getConnection(java.net.URL url)
          Creates a new connection.
static byte[] retrieveBytes(java.lang.String url)
          Retrieves the page content as a byte array.
static byte[] retrieveBytes(java.net.URL url)
          Retrieves the page content as a byte array.
static java.lang.String retrievePage(java.lang.String url)
          Retrieves the page content (UTF8).
static java.lang.String retrievePage(java.lang.String url, java.lang.String charset)
          Retrieves the page content using the supplied character set.
static java.lang.String retrievePage(java.net.URL url)
          Retrieves the page content (UTF8).
static java.lang.String retrievePage(java.net.URL url, java.lang.String charset)
          Retrieves the page content using the supplied character set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpConnectionUtil

public HttpConnectionUtil()
Method Detail

getConnection

public static HttpConnection getConnection(java.net.URL url)
                                    throws HttpConnectionException
Creates a new connection.

Parameters:
url -
Returns:
Throws:
HttpConnectionException

retrievePage

public static java.lang.String retrievePage(java.lang.String url)
                                     throws HttpConnectionException
Retrieves the page content (UTF8).

Parameters:
url -
Returns:
Throws:
HttpConnectionException

retrievePage

public static java.lang.String retrievePage(java.lang.String url,
                                            java.lang.String charset)
                                     throws HttpConnectionException
Retrieves the page content using the supplied character set.

Parameters:
url -
charset -
Throws:
HttpConnectionException

retrievePage

public static java.lang.String retrievePage(java.net.URL url)
                                     throws HttpConnectionException
Retrieves the page content (UTF8).

Parameters:
url -
Throws:
HttpConnectionException

retrievePage

public static java.lang.String retrievePage(java.net.URL url,
                                            java.lang.String charset)
                                     throws HttpConnectionException
Retrieves the page content using the supplied character set.

Parameters:
url -
charset -
Throws:
HttpConnectionException

retrieveBytes

public static byte[] retrieveBytes(java.lang.String url)
                            throws HttpConnectionException
Retrieves the page content as a byte array.

Parameters:
url -
Throws:
HttpConnectionException

retrieveBytes

public static byte[] retrieveBytes(java.net.URL url)
                            throws HttpConnectionException
Retrieves the page content as a byte array.

Parameters:
url -
Throws:
HttpConnectionException