home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &… the Search for Life CD 3 / 0_CD-ROM.iso / install / jre1_3 / lib / rt.jar / sun / misc / PathPermissions.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  1.7 KB  |  75 lines

  1. package sun.misc;
  2.  
  3. import java.io.File;
  4. import java.net.URL;
  5. import java.security.AccessController;
  6. import java.security.Permission;
  7. import java.security.PermissionCollection;
  8. import java.security.Permissions;
  9. import java.util.Enumeration;
  10. import java.util.PropertyPermission;
  11.  
  12. class PathPermissions extends PermissionCollection {
  13.    private static final long serialVersionUID = 8133287259134945693L;
  14.    private File[] path;
  15.    private Permissions perms;
  16.    URL codeBase;
  17.  
  18.    PathPermissions(File[] var1) {
  19.       this.path = var1;
  20.       this.perms = null;
  21.       this.codeBase = null;
  22.    }
  23.  
  24.    URL getCodeBase() {
  25.       return this.codeBase;
  26.    }
  27.  
  28.    public void add(Permission var1) {
  29.       throw new SecurityException("attempt to add a permission");
  30.    }
  31.  
  32.    private synchronized void init() {
  33.       if (this.perms == null) {
  34.          this.perms = new Permissions();
  35.          this.perms.add(new RuntimePermission("createClassLoader"));
  36.          this.perms.add(new PropertyPermission("java.*", "read"));
  37.          AccessController.doPrivileged(new 1(this));
  38.       }
  39.    }
  40.  
  41.    public boolean implies(Permission var1) {
  42.       if (this.perms == null) {
  43.          this.init();
  44.       }
  45.  
  46.       return this.perms.implies(var1);
  47.    }
  48.  
  49.    public Enumeration elements() {
  50.       if (this.perms == null) {
  51.          this.init();
  52.       }
  53.  
  54.       return this.perms.elements();
  55.    }
  56.  
  57.    public String toString() {
  58.       if (this.perms == null) {
  59.          this.init();
  60.       }
  61.  
  62.       return this.perms.toString();
  63.    }
  64.  
  65.    // $FF: synthetic method
  66.    static File[] access$000(PathPermissions var0) {
  67.       return var0.path;
  68.    }
  69.  
  70.    // $FF: synthetic method
  71.    static Permissions access$100(PathPermissions var0) {
  72.       return var0.perms;
  73.    }
  74. }
  75.