home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &n…he Search for Life DVD 2 / DVD-ROM.iso / install / jre1_3 / lib / rt.jar / sun / net / www / protocol / gopher / GopherURLConnection.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  1.1 KB  |  35 lines

  1. package sun.net.www.protocol.gopher;
  2.  
  3. import java.io.IOException;
  4. import java.io.InputStream;
  5. import java.net.SocketPermission;
  6. import java.net.URL;
  7. import java.security.Permission;
  8. import sun.net.www.URLConnection;
  9.  
  10. class GopherURLConnection extends URLConnection {
  11.    Permission permission;
  12.  
  13.    GopherURLConnection(URL var1) {
  14.       super(var1);
  15.    }
  16.  
  17.    public void connect() throws IOException {
  18.    }
  19.  
  20.    public InputStream getInputStream() throws IOException {
  21.       return (new GopherClient(this)).openStream(super.url);
  22.    }
  23.  
  24.    public Permission getPermission() {
  25.       if (this.permission == null) {
  26.          int var1 = super.url.getPort();
  27.          var1 = var1 < 0 ? 70 : var1;
  28.          String var2 = super.url.getHost() + ":" + super.url.getPort();
  29.          this.permission = new SocketPermission(var2, "connect");
  30.       }
  31.  
  32.       return this.permission;
  33.    }
  34. }
  35.