edu.northwestern.at.utils.net.http
Class HTTPUtils

java.lang.Object
  extended by edu.northwestern.at.utils.net.http.HTTPUtils

public class HTTPUtils
extends java.lang.Object

Methods for working with HTTP protocol connections.


Constructor Summary
protected HTTPUtils()
          Don't allow instantiation, but do allow overrides.
 
Method Summary
static java.lang.String getURLContents(java.lang.String urlString)
          Load contents at URL into a string.
static java.lang.String getURLContents(java.lang.String urlString, java.lang.String eolString)
          Load contents at URL into a string.
static java.lang.String getURLContents(java.lang.String urlString, java.lang.String encoding, java.lang.String eolString)
          Load contents at URL into a string.
static java.lang.String getURLContents(java.net.URL url)
          Load contents at URL into a string.
static java.lang.String getURLContents(java.net.URL url, java.lang.String eolString)
          Load contents at URL into a string.
static java.lang.String getURLContents(java.net.URL url, java.lang.String encoding, java.lang.String eolString)
          Load contents at URL into a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTTPUtils

protected HTTPUtils()
Don't allow instantiation, but do allow overrides.

Method Detail

getURLContents

public static java.lang.String getURLContents(java.lang.String urlString,
                                              java.lang.String encoding,
                                              java.lang.String eolString)
Load contents at URL into a string.

Parameters:
urlString - The URL in string form.
encoding - The encoding (e.g, ""UTF-8"). May be empty or null.
eolString - String with which to replace end of line character(s). May be empty or null.
Returns:
The contents specified by the URL. If urlString is empty or null, an empty string is returned.

getURLContents

public static java.lang.String getURLContents(java.net.URL url,
                                              java.lang.String encoding,
                                              java.lang.String eolString)
Load contents at URL into a string.

Parameters:
url - The URL.
encoding - The encoding (e.g, ""UTF-8"). May be empty or null.
eolString - String with which to replace end of line character(s). May be empty or null.
Returns:
The contents specified by the URL. If urlString is empty or null, an empty string is returned.

getURLContents

public static java.lang.String getURLContents(java.lang.String urlString,
                                              java.lang.String eolString)
Load contents at URL into a string.

Parameters:
urlString - The URL in string form.
eolString - String with which to replace end of line character(s). May be empty or null.
Returns:
The contents specified by the URL. If urlString is empty or null, an empty string is returned.

getURLContents

public static java.lang.String getURLContents(java.net.URL url,
                                              java.lang.String eolString)
Load contents at URL into a string.

Parameters:
url - The URL.
eolString - String with which to replace end of line character(s). May be empty or null.
Returns:
The contents specified by the URL. If urlString is empty or null, an empty string is returned.

getURLContents

public static java.lang.String getURLContents(java.lang.String urlString)
Load contents at URL into a string.

Parameters:
urlString - The URL in string form.
Returns:
The contents specified by the URL. If urlString is empty or null, an empty string is returned.

getURLContents

public static java.lang.String getURLContents(java.net.URL url)
Load contents at URL into a string.

Parameters:
url - The URL.
Returns:
The contents specified by the URL. If url is null, an empty string is returned.