Class Handler

  • Direct Known Subclasses:
    Handler

    public class Handler
    extends URLStreamHandler
    open an http input stream given a URL
    • Constructor Detail

      • Handler

        public Handler()
    • Method Detail

      • getDefaultPort

        protected int getDefaultPort()
        Description copied from class: URLStreamHandler
        Returns the default port for a URL parsed by this handler. This method is meant to be overidden by handlers with default port numbers.
        Overrides:
        getDefaultPort in class URLStreamHandler
        Returns:
        the default port for a URL parsed by this handler.
      • openConnection

        protected URLConnection openConnection​(URL u)
                                        throws IOException
        Description copied from class: URLStreamHandler
        Opens a connection to the object referenced by the URL argument. This method should be overridden by a subclass.

        If for the handler's protocol (such as HTTP or JAR), there exists a public, specialized URLConnection subclass belonging to one of the following packages or one of their subpackages: java.lang, java.io, java.util, java.net, the connection returned will be of that subclass. For example, for HTTP an HttpURLConnection will be returned, and for JAR a JarURLConnection will be returned.

        Specified by:
        openConnection in class URLStreamHandler
        Parameters:
        u - the URL that this connects to.
        Returns:
        a URLConnection object for the URL.
        Throws:
        IOException - if an I/O error occurs while opening the connection.