public class WebPage
extends java.lang.Object
Constructor and Description |
---|
WebPage() |
Modifier and Type | Method and Description |
---|---|
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.
|
public static java.lang.String getWebPage(java.lang.String urlString)
urlString
- String
representation of the URL
to get the page from. The URL must be absolute.String
containing the contents of the
page. No extra parsing work is done on the page.public static java.lang.String getWebPage(java.net.URL url)
URL
object.url
- The URL
object that the page will be
downloaded from.String
containing the contents of the
page. No extra parsing work is done on the page.public static void main(java.lang.String[] args)