ir.webutils
Class WebPage

java.lang.Object
  extended by ir.webutils.WebPage

public class WebPage
extends java.lang.Object

WebPage is a static utility class that provides operations for downloading web pages.


Constructor Summary
WebPage()
           
 
Method Summary
static java.lang.String getWebPage(java.lang.String urlString)
          Downloads the web page specified by the URL represented by a given string.
static java.lang.String getWebPage(java.net.URL url)
          Downloads the web page specified by the given URL object.
static void main(java.lang.String[] args)
          Retrieve the page on the URL given and output its contents to STDOUT.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebPage

public WebPage()
Method Detail

getWebPage

public static java.lang.String getWebPage(java.lang.String urlString)
Downloads the web page specified by the URL represented by a given string.

Parameters:
urlString - String representation of the URL to get the page from. The URL must be absolute.
Returns:
A String containing the contents of the page. No extra parsing work is done on the page.

getWebPage

public static java.lang.String getWebPage(java.net.URL url)
Downloads the web page specified by the given URL object.

Parameters:
url - The URL object that the page will be downloaded from.
Returns:
A String containing the contents of the page. No extra parsing work is done on the page.

main

public static void main(java.lang.String[] args)
Retrieve the page on the URL given and output its contents to STDOUT.