home *** CD-ROM | disk | FTP | other *** search
- package sun.net.www.protocol.gopher;
-
- import java.io.IOException;
- import java.io.InputStream;
- import java.net.SocketPermission;
- import java.net.URL;
- import java.security.Permission;
- import sun.net.www.URLConnection;
-
- class GopherURLConnection extends URLConnection {
- Permission permission;
-
- GopherURLConnection(URL var1) {
- super(var1);
- }
-
- public void connect() throws IOException {
- }
-
- public InputStream getInputStream() throws IOException {
- return (new GopherClient(this)).openStream(super.url);
- }
-
- public Permission getPermission() {
- if (this.permission == null) {
- int var1 = super.url.getPort();
- var1 = var1 < 0 ? 70 : var1;
- String var2 = super.url.getHost() + ":" + super.url.getPort();
- this.permission = new SocketPermission(var2, "connect");
- }
-
- return this.permission;
- }
- }
-