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.
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.
Returns:
a
URLConnection
object for the
URL
.
Parameters:
-
u - the URL that this connects to.
-
p - the proxy through which the connection will be made.
If direct connection is desired, Proxy.NO_PROXY
should be specified.
Throws:
-
IOException - if an I/O error occurs while opening the
connection.
-
IllegalArgumentException - if either u or p is null,
or p has the wrong type.
-
UnsupportedOperationException - if the subclass that
implements the protocol doesn't support this method.
Since:
1.5