org.elite.jdcbot.util
Class WebPageFetcher
java.lang.Object
org.elite.jdcbot.util.WebPageFetcher
- Direct Known Subclasses:
- GoogleCalculation
public abstract class WebPageFetcher
- extends java.lang.Object
Fetches the HTML content of a web page as a String.
Idea is to use derived class, example can be found in GoogleCalculation class
This class just fetches the page, to parse things you want from web page, use derived class
- Since:
- 0.6
- Version:
- 0.6
- Author:
- Kokanovic Branko
Field Summary |
private static java.lang.String |
fHTTP
|
private static java.lang.String |
fNEWLINE
|
private java.net.URL |
fURL
|
Method Summary |
protected java.lang.String |
getPageContent()
Fetch the HTML content of the page as simple text. |
java.lang.String |
getPageHeader()
Fetch the HTML headers as simple text. |
protected void |
SetURL(java.lang.String aUrlName)
|
protected void |
SetURL(java.net.URL aURL)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
fURL
private java.net.URL fURL
fHTTP
private static final java.lang.String fHTTP
- See Also:
- Constant Field Values
fNEWLINE
private static final java.lang.String fNEWLINE
WebPageFetcher
public WebPageFetcher(java.net.URL aURL)
WebPageFetcher
public WebPageFetcher(java.lang.String aUrlName)
throws java.net.MalformedURLException
- Throws:
java.net.MalformedURLException
WebPageFetcher
public WebPageFetcher()
SetURL
protected void SetURL(java.net.URL aURL)
SetURL
protected void SetURL(java.lang.String aUrlName)
throws java.net.MalformedURLException
- Throws:
java.net.MalformedURLException
getPageContent
protected java.lang.String getPageContent()
throws java.net.UnknownHostException,
java.io.IOException
- Fetch the HTML content of the page as simple text.
- Throws:
java.net.UnknownHostException
java.io.IOException
getPageHeader
public java.lang.String getPageHeader()
- Fetch the HTML headers as simple text.