Package games.stendhal.client.update
Class HttpClient
java.lang.Object
games.stendhal.client.update.HttpClient
a very simple http client.
- Author:
- hendrik
-
Constructor Summary
ConstructorsConstructorDescriptionHttpClient(String url) Creates a HTTP-Client which will connect to the specified URL. -
Method Summary
Modifier and TypeMethodDescriptionfetches the first line of a file using http and closes the connection automatically.Return an InputStream to read the requested file from.voidsetProgressListener(games.stendhal.client.update.HttpClient.ProgressListener progressListener) Sets a ProgressListener to be informed of download progress.
-
Constructor Details
-
HttpClient
Creates a HTTP-Client which will connect to the specified URL.- Parameters:
url- URL to connect to
-
-
Method Details
-
setProgressListener
public void setProgressListener(games.stendhal.client.update.HttpClient.ProgressListener progressListener) Sets a ProgressListener to be informed of download progress.- Parameters:
progressListener- ProgressListener
-
getInputStream
Return an InputStream to read the requested file from. You have to close it using- Returns:
- InputStream or null on error.
- See Also:
-
close()
-
fetchFirstLine
fetches the first line of a file using http and closes the connection automatically.- Returns:
- the first line
-