Package sun.net.www.protocol.http
Class Handler
- java.lang.Object
-
- java.net.URLStreamHandler
-
- sun.net.www.protocol.http.Handler
-
- Direct Known Subclasses:
Handler
public class Handler extends URLStreamHandler
open an http input stream given a URL
-
-
Constructor Summary
Constructors Constructor Description Handler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intgetDefaultPort()Returns the default port for a URL parsed by this handler.protected URLConnectionopenConnection(URL u)Opens a connection to the object referenced by theURLargument.-
Methods inherited from class java.net.URLStreamHandler
equals, hashCode, hostsEqual, parseURL, sameFile, setURL, toExternalForm
-
-
-
-
Method Detail
-
getDefaultPort
protected int getDefaultPort()
Description copied from class:URLStreamHandlerReturns the default port for a URL parsed by this handler. This method is meant to be overidden by handlers with default port numbers.- Overrides:
getDefaultPortin classURLStreamHandler- Returns:
- the default port for a
URLparsed by this handler.
-
openConnection
protected URLConnection openConnection(URL u) throws IOException
Description copied from class:URLStreamHandlerOpens a connection to the object referenced by theURLargument. 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.
- Specified by:
openConnectionin classURLStreamHandler- Parameters:
u- the URL that this connects to.- Returns:
- a
URLConnectionobject for theURL. - Throws:
IOException- if an I/O error occurs while opening the connection.
-
-