geneseo.cs.sc
Class WebPage

java.lang.Object
  extended bygeneseo.cs.sc.WebPage

public class WebPage
extends java.lang.Object

Represents a Web page, i.e., a long string of text that (presumably) lives on a Web server somewhere and is identified by a URL. This class provides a much simpler, but less functional, interface to Web pages than the standard Java library classes do.


Constructor Summary
WebPage(java.lang.String url)
          Initialize a Web page.
 
Method Summary
 java.lang.String getText()
          Return the text stored in a Web page, as a long string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebPage

public WebPage(java.lang.String url)
Initialize a Web page. For example

   WebPage page = new WebPage( "http://www.somewhere.com" );
 

Parameters:
url - The URL for the page this object should represent.
Method Detail

getText

public java.lang.String getText()
Return the text stored in a Web page, as a long string. For example

   String pageText = somePage.getText();
 

Returns:
The contents of the page, or null if the page couldn't be fetched from its server for any reason.