public class HTTPCommunicator
extends java.lang.Object
| Constructor and Description |
|---|
HTTPCommunicator()
Create a new HTTPCommunicator; use a default user-agent string.
|
HTTPCommunicator(java.lang.String agent)
Create a new HTTPCommunicator; set the user-agent string to the one provided.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getAgent()
Returns a user-agent string, e.g.
|
java.lang.String |
getPageForRef(java.lang.String pageURL)
This method will take a url (as a string) as an input and return the body of the
page that is returned.
|
java.lang.String |
getPageForRef(java.lang.String hostname,
int port,
java.lang.String uri)
This method will take a url (as a string) as an input and return the body of the
page that is returned.
|
static void |
main(java.lang.String[] args)
main method to serve as simple tester.
|
void |
setUserAgent(java.lang.String s)
Set user agent string
|
public HTTPCommunicator()
public HTTPCommunicator(java.lang.String agent)
public void setUserAgent(java.lang.String s)
public java.lang.String getAgent()
public java.lang.String getPageForRef(java.lang.String pageURL)
throws java.net.MalformedURLException,
java.io.IOException
java.net.MalformedURLExceptionjava.io.IOExceptionpublic java.lang.String getPageForRef(java.lang.String hostname,
int port,
java.lang.String uri)
throws java.io.IOException
java.io.IOExceptionpublic static void main(java.lang.String[] args)