home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 1999 March / maximum-cd-1999-03.iso / Feature / Lotus / ORGANIZE / COMPNENT / LTOUIN21.ZIP / sun / activator / protocol / http / Handler.class (.txt) next >
Encoding:
Java Class File  |  1998-03-12  |  1.2 KB  |  40 lines

  1. package sun.activator.protocol.http;
  2.  
  3. import java.io.IOException;
  4. import java.net.URL;
  5. import java.net.URLConnection;
  6. import sun.activator.protocol.ProxyHandler;
  7. import sun.activator.protocol.ProxyInfo;
  8.  
  9. public class Handler extends sun.net.www.protocol.http.Handler {
  10.    static ProxyHandler handler = null;
  11.  
  12.    public static void setProxyHandler(ProxyHandler var0) {
  13.       handler = var0;
  14.    }
  15.  
  16.    public URLConnection openConnection(URL var1) throws IOException {
  17.       ProxyInfo var2 = null;
  18.       super.proxy = null;
  19.       super.proxyPort = -1;
  20.       if (handler != null) {
  21.          var2 = handler.getProxyInfo(var1);
  22.       }
  23.  
  24.       if (var2 != null) {
  25.          super.proxy = var2.getProxy();
  26.          super.proxyPort = var2.getPort();
  27.       }
  28.  
  29.       return new HttpURLConnection(var1, this);
  30.    }
  31.  
  32.    String getProxy() {
  33.       return super.proxy;
  34.    }
  35.  
  36.    int getPort() {
  37.       return super.proxyPort;
  38.    }
  39. }
  40.