<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Wed Jul 28 01:21:15 GMT 1999 -->
<title>
  Class java.net.URLStreamHandler
</title>
</head>
<body>
<a name="_top_"></a>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.net.html">This Package</a>  <a href="java.net.URLEncoder.html#_top_">Previous</a>  <a href="Package-java.net.html">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class java.net.URLStreamHandler
</h1>
<pre>
<a href="java.lang.Object.html#_top_">java.lang.Object</a>
   |
   +----java.net.URLStreamHandler
</pre>
<hr>
<dl>
  <dt> public abstract class <b>URLStreamHandler</b>
  <dt> extends <a href="java.lang.Object.html#_top_">Object</a>
</dl>
The abstract class <code>URLStreamHandler</code> 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 <code>http</code>, <code>ftp</code>, or
 <code>gopher</code>.
 <p>In most cases, an instance of a <code>URLStreamHandler</code>
 subclass is not created directly by an application. Rather, the
 first time a protocol name is encountered when constructing a
 <code>URL</code>, the appropriate stream protocol handler is
 automatically loaded.
<p>
<dl>
    <dt> <b>See Also:</b>
    <dd> <a href="java.net.URL.html#URL(java.lang.String, java.lang.String, int,
 java.lang.String)">URL</a>
</dl>
<hr>
<a name="index"></a>
<h2>
  <img src="images/constructor-index.gif" width=275 height=38 alt="Constructor Index">
</h2>
<dl>
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#URLStreamHandler()"><b>URLStreamHandler</b></a>()
  <dd> 
</dl>
<h2>
  <img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#openConnection(java.net.URL)"><b>openConnection</b></a>(URL)
  <dd>  Opens a connection to the object referenced by the 
 <code>URL</code> argument.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#parseURL(java.net.URL, java.lang.String, int, int)"><b>parseURL</b></a>(URL, String, int, int)
  <dd> 
 Parses the string representation of a <code>URL</code> into a 
 <code>URL</code> object.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setURL(java.net.URL, java.lang.String, java.lang.String, int, java.lang.String, java.lang.String)"><b>setURL</b></a>(URL, String, String, int, String, String)
  <dd>  Sets the fields of the <code>URL</code> argument to the
 indicated values.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#toExternalForm(java.net.URL)"><b>toExternalForm</b></a>(URL)
  <dd>  Converts a <code>URL</code> of a specific protocol to a 
 <code>String</code>.
</dl>
<a name="constructors"></a>
<h2>
  <img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="URLStreamHandler"></a>
<a name="URLStreamHandler()"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>URLStreamHandler</b>
<pre>
 public URLStreamHandler()
</pre>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="openConnection(java.net.URL)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="openConnection"><b>openConnection</b></a>
<pre>
 protected abstract <a href="java.net.URLConnection.html#_top_">URLConnection</a> openConnection(<a href="java.net.URL.html#_top_">URL</a> u) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Opens a connection to the object referenced by the 
 <code>URL</code> argument. 
 This method should be overridden by a subclass.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> u - the URL that this connects to.
    <dt> <b>Returns:</b>
    <dd> a <code>URLConnection</code> object for the
 <code>URL</code>.
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> if an I/O error occurs while opening the
               connection.
  </dl></dd>
</dl>
<a name="parseURL(java.net.URL, java.lang.String, int, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="parseURL"><b>parseURL</b></a>
<pre>
 protected void parseURL(<a href="java.net.URL.html#_top_">URL</a> u,
                         <a href="java.lang.String.html#_top_">String</a> spec,
                         int start,
                         int limit)
</pre>
<dl>
  <dd> Parses the string representation of a <code>URL</code> into a 
 <code>URL</code> object. 
 <p>If there is any inherited context, then it has already been
 copied into the <code>URL</code> argument.
 <p> The <code>parseURL</code> method of
 <code>URLStreamHandler</code> parses the string representation
 as if it were an <code>http</code> 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.
 <p>If the file component of the URL argument contains a
 question mark (as with CGI HTTP URLs), the context is
 considered to be the URL's file component up to the first /
 before the question mark, not including the question mark or
 the directory before it. For example, if the URL was:
 <br><pre>    http://www.foo.com/dir/cgi-bin?foo=bar/baz</pre>
 and the spec argument was
 <br><pre>    quux.html</pre>
 the resulting URL would be:
 <br><pre>    http://www.foo.com/dir/quux.html</pre>.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> u - the <code>URL</code> to receive the result of parsing
 the spec.
    <dd> spec - the <code>String</code> representing the URL that
 must be parsed.
    <dd> start - the character index at which to begin
 parsing. This is just past the '<code>:</code>' (if there is
 one) that specifies the determination of the protocol name.
    <dd> limit - the character position to stop parsing at. This is
 the end of the string or the position of the "<code>#</code>"
 character, if present. All information after the sharp sign
 indicates an anchor.
  </dl></dd>
</dl>
<a name="toExternalForm(java.net.URL)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="toExternalForm"><b>toExternalForm</b></a>
<pre>
 protected <a href="java.lang.String.html#_top_">String</a> toExternalForm(<a href="java.net.URL.html#_top_">URL</a> u)
</pre>
<dl>
  <dd> Converts a <code>URL</code> of a specific protocol to a 
 <code>String</code>.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> u - the URL.
    <dt> <b>Returns:</b>
    <dd> a string representation of the <code>URL</code> argument.
  </dl></dd>
</dl>
<a name="setURL(java.net.URL, java.lang.String, java.lang.String, int, java.lang.String, java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setURL"><b>setURL</b></a>
<pre>
 protected void setURL(<a href="java.net.URL.html#_top_">URL</a> u,
                       <a href="java.lang.String.html#_top_">String</a> protocol,
                       <a href="java.lang.String.html#_top_">String</a> host,
                       int port,
                       <a href="java.lang.String.html#_top_">String</a> file,
                       <a href="java.lang.String.html#_top_">String</a> ref)
</pre>
<dl>
  <dd> Sets the fields of the <code>URL</code> argument to the
 indicated values.  Only classes derived from URLStreamHandler
 are supposed to be able to call the set method on a URL.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> u - the URL to modify.
    <dd> protocol - the protocol name.
    <dd> host - the remote host value for the URL.
    <dd> port - the port on the remote machine.
    <dd> file - the file.
    <dd> ref - the reference.
    <dt> <b>See Also:</b>
    <dd> <a href="java.net.URL.html#set(java.lang.String, java.lang.String, int,
 java.lang.String, java.lang.String)">set</a>
  </dl></dd>
</dl>
<hr>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.net.html">This Package</a>  <a href="java.net.URLEncoder.html#_top_">Previous</a>  <a href="Package-java.net.html">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
