Class HttpClient

java.lang.Object
games.stendhal.client.update.HttpClient

public class HttpClient extends Object
a very simple http client.
Author:
hendrik
  • Constructor Details

    • HttpClient

      public HttpClient(String url)
      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

      public InputStream 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

      public String fetchFirstLine()
      fetches the first line of a file using http and closes the connection automatically.
      Returns:
      the first line