Top Description Fields Constructors Methods
sun.net.www.protocol.https

public Class Handler

extends Handler
Class Inheritance
Imports
java.io.IOException, java.net.URL, .Proxy

open an http input stream given a URL

Field Summary

Modifier and TypeField and Description
protected String
protected int

Constructor Summary

AccessConstructor and Description
public
public
Handler(String proxy, int port)

Method Summary

Modifier and TypeMethod and Description
protected int
getDefaultPort()

Overrides sun.net.www.protocol.http.Handler.getDefaultPort.

Returns the default port for a URL parsed by this handler.

protected URLConnection
openConnection(URL
the URL that this connects to.
u
)

Overrides sun.net.www.protocol.http.Handler.openConnection.

Opens a connection to the object referenced by the URL argument.

protected URLConnection
openConnection(URL
the URL that this connects to.
u
,
Proxy
the proxy through which the connection will be made. If direct connection is desired, Proxy.NO_PROXY should be specified.
p
)

Overrides sun.net.www.protocol.http.Handler.openConnection.

Same as openConnection(URL), except that the connection will be made through the specified proxy; Protocol handlers that do not support proxying will ignore the proxy parameter and make a normal connection.

Field Detail

proxyback to summary
protected String proxy

Hides sun.net.www.protocol.http.Handler.proxy.

proxyPortback to summary
protected int proxyPort

Hides sun.net.www.protocol.http.Handler.proxyPort.

Constructor Detail

Handlerback to summary
public Handler()
Handlerback to summary
public Handler(String proxy, int port)

Method Detail

getDefaultPortback to summary
protected int getDefaultPort()

Overrides sun.net.www.protocol.http.Handler.getDefaultPort.

Doc from java.net.URLStreamHandler.getDefaultPort.

Returns the default port for a URL parsed by this handler. This method is meant to be overridden by handlers with default port numbers.

Returns:int

the default port for a URL parsed by this handler.

openConnectionback to summary
protected URLConnection openConnection(URL u) throws IOException

Overrides sun.net.www.protocol.http.Handler.openConnection.

Doc from java.net.URLStreamHandler.openConnection.

Opens a connection to the object referenced by the 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.

Parameters
u:URL

the URL that this connects to.

Returns:URLConnection

a URLConnection object for the URL.

Exceptions
IOException:
if an I/O error occurs while opening the connection.
openConnectionback to summary
protected URLConnection openConnection(URL u, Proxy p) throws IOException

Overrides sun.net.www.protocol.http.Handler.openConnection.

Doc from java.net.URLStreamHandler.openConnection.

Same as openConnection(URL), except that the connection will be made through the specified proxy; Protocol handlers that do not support proxying will ignore the proxy parameter and make a normal connection.

Calling this method preempts the system's default ProxySelector settings.

Parameters
u:URL

the URL that this connects to.

p:Proxy

the proxy through which the connection will be made. If direct connection is desired, Proxy.NO_PROXY should be specified.

Returns:URLConnection

a URLConnection object for the URL.

Exceptions
IOException:
if an I/O error occurs while opening the connection.