public class Handler extends Handler
Constructor and Description |
---|
Handler() |
Modifier and Type | Method and Description |
---|---|
protected int |
getDefaultPort()
Returns the default port for a URL parsed by this handler.
|
protected URLConnection |
openConnection(URL u)
Opens a connection to the object referenced by the
URL argument. |
equals, hashCode, hostsEqual, parseURL, sameFile, setURL, toExternalForm
protected int getDefaultPort()
URLStreamHandler
getDefaultPort
in class Handler
URL
parsed by this handler.protected URLConnection openConnection(URL u) throws IOException
URLStreamHandler
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.
openConnection
in class Handler
u
- the URL that this connects to.URLConnection
object for the URL
.IOException
- if an I/O error occurs while opening the
connection.