Class HttpHttpsURL

java.lang.Object
org.vanted.updater.HttpHttpsURL

public class HttpHttpsURL
extends Object
Handles automatic redirects from http to https.
Since:
2.7.0
Author:
Dimitar
  • Constructor Details

    • HttpHttpsURL

      public HttpHttpsURL​(String spec)
  • Method Details

    • getURL

      public String getURL()
      This returns the URL's spec. Use it to initialize a URL object.
      Returns:
      URL's spec
    • setURL

      public void setURL​(String spec)
      Set URL's spec.
      Parameters:
      spec -
    • openStream

      public InputStream openStream() throws IOException
      This method is a shorthand for:

      openConnection().getInputStream()

      with support for Http-Https redirect.
      Returns:
      Throws:
      IOException
    • openConnection

      public HttpURLConnection openConnection() throws IOException
      Use this method to open connections with both Http and Https protocols. Also any errors are therewith reported to the user.
      Returns:
      a successfully opened connection
      Throws:
      IOException