home *** CD-ROM | disk | FTP | other *** search
- package sun.activator.protocol.http;
-
- import java.io.IOException;
- import java.net.URL;
- import java.net.URLConnection;
- import sun.activator.protocol.ProxyHandler;
- import sun.activator.protocol.ProxyInfo;
-
- public class Handler extends sun.net.www.protocol.http.Handler {
- static ProxyHandler handler = null;
-
- public static void setProxyHandler(ProxyHandler var0) {
- handler = var0;
- }
-
- public URLConnection openConnection(URL var1) throws IOException {
- ProxyInfo var2 = null;
- super.proxy = null;
- super.proxyPort = -1;
- if (handler != null) {
- var2 = handler.getProxyInfo(var1);
- }
-
- if (var2 != null) {
- super.proxy = var2.getProxy();
- super.proxyPort = var2.getPort();
- }
-
- return new HttpURLConnection(var1, this);
- }
-
- String getProxy() {
- return super.proxy;
- }
-
- int getPort() {
- return super.proxyPort;
- }
- }
-