|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.net.URLStreamHandler
Abstract class for URL stream openers. Subclasses of this class know how to create streams for particular protocol types.
Constructor Summary | |
URLStreamHandler()
|
Method Summary | |
protected abstract URLConnection |
openConnection(URL u)
Opens an input stream to the object referenced by the URL. |
protected void |
parseURL(URL u,
String spec,
int start,
int limit)
This method is called to parse the string spec into URL u. |
protected void |
setURL(URL u,
String protocol,
String host,
int port,
String file,
String ref)
Calls the (protected) set method out of the URL given. |
protected String |
toExternalForm(URL u)
Reverses the parsing of the URL. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public URLStreamHandler()
Method Detail |
protected abstract URLConnection openConnection(URL u) throws IOException
u
- the URL that this connects to
IOException
protected void parseURL(URL u, String spec, int start, int limit)
start
and
limit
refer to the range of characters in spec
that should be parsed. The default method uses parsing rules
that match the http spec, which most URL protocol families
follow. If you are writing a protocol handler that has a
different syntax, override this routine.
u
- the URL to receive the result of parsing the specspec
- the URL string to parsestart
- the character position to start parsing at. This is
just past the ':' (if there is one).limit
- the character position to stop parsing at. This is
the end of the string or the position of the "#"
character if present (the "#" reference syntax is
protocol independent).protected String toExternalForm(URL u)
u
- the URL
protected void setURL(URL u, String protocol, String host, int port, String file, String ref)
URL.set(java.lang.String, java.lang.String, int, java.lang.String, java.lang.String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |