|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectio.HttpHandler
public class HttpHandler
A class, implemented as a Thread, for dealing with HTTP requests.
The class can be used in two ways:
getResponseFromURL(url) to get
the response converted to a string from the given url
| Constructor Summary | |
|---|---|
HttpHandler(java.lang.String strUrl)
Creates a thread for calling an URL asynchronously. |
|
| Method Summary | |
|---|---|
static byte[] |
getByteArrayFromURL(java.lang.String url)
Returns the stream from a successfull HTTP request |
static java.lang.String |
getResponseFromURL(java.lang.String url)
Returns the response from a successfull HTTP request as a string |
void |
run()
This method sends an asynchronous HTTP GET request to the url, that was set in the constructor. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HttpHandler(java.lang.String strUrl)
strUrl - the URL to send the HTTP request| Method Detail |
|---|
public void run()
run in interface java.lang.Runnable
public static java.lang.String getResponseFromURL(java.lang.String url)
throws java.io.IOException
url - the url where to get the response from
java.io.IOException - thrown if resource is not found
public static byte[] getByteArrayFromURL(java.lang.String url)
throws java.io.IOException
url - the url where to get the response from
java.io.IOException - thrown if resource is not found
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||