public class

Handler

extends URLStreamHandler
java.lang.Object
   ↳ java.net.URLStreamHandler
     ↳ sun.net.www.protocol.jar.Handler

Summary

Public Constructors
Handler()
Protected Methods
URLConnection openConnection(URL u)
Opens a connection to the object referenced by the URL argument.
void parseURL(URL url, String spec, int start, int limit)
Parses the string representation of a URL into a URL object.
[Expand]
Inherited Methods
From class java.net.URLStreamHandler
From class java.lang.Object

Public Constructors

public Handler ()

Protected Methods

protected URLConnection openConnection (URL u)

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.

Parameters
u the URL that this connects to.
Returns
  • a URLConnection object for the URL.
Throws
IOException

protected void parseURL (URL url, String spec, int start, int limit)

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 URL argument.

The parseURL method of URLStreamHandler parses the string representation as if it were an http specification. Most URL protocol families have a similar parsing. A stream protocol handler for a protocol that has a different syntax must override this routine.

Parameters
url the URL to receive the result of parsing the spec.
spec the String representing the URL that must be parsed.
start the character index at which to begin parsing. This is just past the ':' (if there is one) that specifies the determination of the protocol name.
limit the character position to stop parsing at. This is the end of the string or the position of the "#" character, if present. All information after the sharp sign indicates an anchor.