IT. Expert System.

Android Reference

URLStreamHandler


java.net

Class URLStreamHandler

  • Direct Known Subclasses:
    Handler


    public abstract class URLStreamHandler
    extends Object
    The abstract class URLStreamHandler is the base for all classes which can handle the communication with a URL object over a particular protocol type.
    • Constructor Detail

      • URLStreamHandler

        public URLStreamHandler()
    • Method Detail

      • openConnection

        protected abstract URLConnection openConnection(URL u)
                                                 throws IOException
        Establishes a new connection to the resource specified by the URL u. Since different protocols also have unique ways of connecting, it must be overwritten by the subclass.
        Parameters:
        u - the URL to the resource where a connection has to be opened.
        Returns:
        the opened URLConnection to the specified resource.
        Throws:
        IOException - if an I/O error occurs during opening the connection.
      • openConnection

        protected URLConnection openConnection(URL u,
                                   Proxy proxy)
                                        throws IOException
        Establishes a new connection to the resource specified by the URL u using the given proxy. Since different protocols also have unique ways of connecting, it must be overwritten by the subclass.
        Parameters:
        u - the URL to the resource where a connection has to be opened.
        proxy - the proxy that is used to make the connection.
        Returns:
        the opened URLConnection to the specified resource.
        Throws:
        IOException - if an I/O error occurs during opening the connection.
        IllegalArgumentException - if any argument is null or the type of proxy is wrong.
        UnsupportedOperationException - if the protocol handler doesn't support this method.
      • parseURL

        protected void parseURL(URL url,
                    String spec,
                    int start,
                    int end)
        Parses the clear text URL in str into a URL object. URL strings generally have the following format:

        http://www.company.com/java/file1.java#reference

        The string is parsed in HTTP format. If the protocol has a different URL format this method must be overridden.

        Parameters:
        url - the URL to fill in the parsed clear text URL parts.
        spec - the URL string that is to be parsed.
        start - the string position from where to begin parsing.
        end - the string position to stop parsing.
        See Also:
        toExternalForm(java.net.URL), URL
      • setURL

        @Deprecated
        protected void setURL(URL u,
                             String protocol,
                             String host,
                             int port,
                             String file,
                             String ref)
        Deprecated. use setURL(URL, String String, int, String, String, String, String, String) instead.
        Sets the fields of the URL u to the values of the supplied arguments.
        Parameters:
        u - the non-null URL object to be set.
        protocol - the protocol.
        host - the host name.
        port - the port number.
        file - the file component.
        ref - the reference.
      • equals

        protected boolean equals(URL a,
                     URL b)
        Returns true if a and b have the same protocol, host, port, file, and reference.
      • getDefaultPort

        protected int getDefaultPort()
        Returns the default port of the protocol used by the handled URL. The default implementation always returns -1.
      • getHostAddress

        protected InetAddress getHostAddress(URL url)
        Returns the host address of url.
      • hashCode

        protected int hashCode(URL url)
        Returns the hash code of url.
      • hostsEqual

        protected boolean hostsEqual(URL a,
                         URL b)
        Returns true if the hosts of a and b are equal.
      • sameFile

        protected boolean sameFile(URL a,
                       URL b)
        Returns true if a and b have the same protocol, host, port and file.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 263 / 158747279. Delta: 0.04014 с