home *** CD-ROM | disk | FTP | other *** search
/ Sky at Night 2007 June / SAN CD 6-2007 CD-ROM 25.iso / pc / Software / AstroGrav_Win / Java / jre1.6.0 / lib / rt.jar / sun / misc / PathPermissions.class (.txt) < prev    next >
Encoding:
Java Class File  |  2006-11-29  |  1.7 KB  |  78 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. import sun.security.util.SecurityConstants;
  12.  
  13. class PathPermissions extends PermissionCollection {
  14.    private static final long serialVersionUID = 8133287259134945693L;
  15.    private File[] path;
  16.    private Permissions perms;
  17.    URL codeBase;
  18.  
  19.    PathPermissions(File[] var1) {
  20.       this.path = var1;
  21.       this.perms = null;
  22.       this.codeBase = null;
  23.    }
  24.  
  25.    URL getCodeBase() {
  26.       return this.codeBase;
  27.    }
  28.  
  29.    public void add(Permission var1) {
  30.       throw new SecurityException("attempt to add a permission");
  31.    }
  32.  
  33.    private synchronized void init() {
  34.       if (this.perms == null) {
  35.          this.perms = new Permissions();
  36.          this.perms.add(SecurityConstants.CREATE_CLASSLOADER_PERMISSION);
  37.          this.perms.add(new PropertyPermission("java.*", "read"));
  38.          AccessController.doPrivileged(new 1(this));
  39.       }
  40.    }
  41.  
  42.    public boolean implies(Permission var1) {
  43.       if (this.perms == null) {
  44.          this.init();
  45.       }
  46.  
  47.       return this.perms.implies(var1);
  48.    }
  49.  
  50.    public Enumeration elements() {
  51.       if (this.perms == null) {
  52.          this.init();
  53.       }
  54.  
  55.       synchronized(this.perms) {
  56.          return this.perms.elements();
  57.       }
  58.    }
  59.  
  60.    public String toString() {
  61.       if (this.perms == null) {
  62.          this.init();
  63.       }
  64.  
  65.       return this.perms.toString();
  66.    }
  67.  
  68.    // $FF: synthetic method
  69.    static File[] access$000(PathPermissions var0) {
  70.       return var0.path;
  71.    }
  72.  
  73.    // $FF: synthetic method
  74.    static Permissions access$100(PathPermissions var0) {
  75.       return var0.perms;
  76.    }
  77. }
  78.