| public abstract class java.net URLStreamHandler
|
Java SE 6 |
URLStreamHandler is the common
superclass for all stream protocol handlers. A stream protocol
handler knows how to make a connection for a particular protocol
type, such as http, ftp, or
gopher.
In most cases, an instance of a URLStreamHandler
subclass is not created directly by an application. Rather, the
first time a protocol name is encountered when constructing a
URL, the appropriate stream protocol handler is
automatically loaded.
| version | 1.73, 04/07/06 |
| since | JDK1.0 |
| See also | URL(java.lang.String, java.lang.String, int, java.lang.String) |
| Constructors | |
|---|---|
| public | URLStreamHandler() |
| Methods | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| protected boolean | equals(URL u1, URL u2) Details
Provides the default equals calculation. May be overidden by handlers
for other protocols that have different requirements for equals().
This method requires that none of its arguments is null. This is
guaranteed by the fact that it is only called by java.net.URL class.
| ||||||||||||||
| protected int | hashCode(URL u) Details
Provides the default hash calculation. May be overidden by handlers for
other protocols that have different requirements for hashCode
calculation.
| ||||||||||||||
| protected boolean | hostsEqual(URL u1, URL u2) Details
Compares the host components of two URLs.
| ||||||||||||||
| abstract protected URLConnection | openConnection(URL u) throws IOException Details
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.
| ||||||||||||||
| protected URLConnection | openConnection(URL u, Proxy p) throws IOException Details
Same as openConnection(URL), except that the connection will be
made through the specified proxy; Protocol handlers that do not
support proxying will ignore the proxy parameter and make a
normal connection.
Calling this method preempts the system's default ProxySelector
settings.
| ||||||||||||||
| protected void | parseURL(URL u, String spec, int start, int limit) Details
Parses the string representation of a URL into a
URL object.
If there is any inherited context, then it has already been
copied into the
The
| ||||||||||||||
| protected boolean | sameFile(URL u1, URL u2) Details
Compare two urls to see whether they refer to the same file,
i.e., having the same protocol, host, port, and path.
This method requires that none of its arguments is null. This is
guaranteed by the fact that it is only called indirectly
by java.net.URL class.
| ||||||||||||||
| protected String | toExternalForm(URL u) Details
Converts a URL of a specific protocol to a
String.
| ||||||||||||||
| Properties | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| protected int | getDefaultPort() Details
Returns the default port for a URL parsed by this handler. This method
is meant to be overidden by handlers with default port numbers.
| ||||||||||||||||||||||||
| protected InetAddress | getHostAddress(URL u) Details
Get the IP address of our host. An empty host field or a DNS failure
will result in a null return.
| ||||||||||||||||||||||||
| protected void | setURL(URL u, String protocol, String host, int port, String authority, String userInfo, String path, String query, String ref) Details
Sets the fields of the URL argument to the indicated values.
Only classes derived from URLStreamHandler are supposed to be able
to call the set method on a URL.
| ||||||||||||||||||||||||
| protected void | Details
Sets the fields of the URL argument to the indicated values.
Only classes derived from URLStreamHandler are supposed to be able
to call the set method on a URL.
| ||||||||||||||||||||||||
| About DocWeb · Bundles · Export · Export All | Top 10 · Statistics · Login |
| About Sun · Contact · Privacy · Terms of Use · Trademarks | Java SE 6 · Copyright © 1994-2009 Sun Microsystems, Inc.All rights reserved. Use is subject to license terms |
![]() |
![]() |
|