public class URLStreamHandler extends Object
Constructor and Description |
---|
URLStreamHandler() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
equals(URL url1,
URL url2)
Provides the default equals calculation.
|
protected int |
getDefaultPort()
Returns the default port for a URL parsed by this handler.
|
protected int |
hashCode(URL url)
Provides the default hash calculation.
|
protected URLConnection |
openConnection(URL u) |
protected void |
parseURL(URL url,
String spec,
int start,
int end)
This method parses the string passed in as a URL and set's the
instance data fields in the URL object passed in to the various values
parsed out of the string.
|
protected void |
setURL(URL u,
String protocol,
String host,
int port,
String file,
String ref)
Deprecated.
1.2 Please use
#setURL(URL,String,String,int,String,String,String,String);
|
protected String |
toExternalForm(URL u)
This method converts a URL object into a String.
|
protected boolean equals(URL url1, URL url2)
url1
- An URL objecturl2
- An URL objectprotected int getDefaultPort()
protected int hashCode(URL url)
protected String toExternalForm(URL u)
url
- The URL object to convertprotected void parseURL(URL url, String spec, int start, int end)
This method assumes URL's are formatted like http protocol URL's, so subclasses that implement protocols with URL's the follow a different syntax should override this method. The lone exception is that if the protocol name set in the URL is "file", this method will accept an empty hostname (i.e., "file:///"), which is legal for that protocol
url
- The URL object in which to store the resultsspec
- The String-ized URL to parsestart
- The position in the string to start scanning fromend
- The position in the string to stop scanningprotected void setURL(URL u, String protocol, String host, int port, String file, String ref)
u
- The URL to modifyprotocol
- The protocol to sethost
- The host name to etport
- The port number to setfile
- The filename to setref
- The referenceSecurityException
- If the protocol handler of the URL is
different from this oneprotected URLConnection openConnection(URL u) throws IOException
IOException