home *** CD-ROM | disk | FTP | other *** search
- package sun.misc;
-
- import java.io.File;
- import java.net.URL;
- import java.security.AccessController;
- import java.security.Permission;
- import java.security.PermissionCollection;
- import java.security.Permissions;
- import java.util.Enumeration;
- import java.util.PropertyPermission;
- import sun.security.util.SecurityConstants;
-
- class PathPermissions extends PermissionCollection {
- private static final long serialVersionUID = 8133287259134945693L;
- private File[] path;
- private Permissions perms;
- URL codeBase;
-
- PathPermissions(File[] var1) {
- this.path = var1;
- this.perms = null;
- this.codeBase = null;
- }
-
- URL getCodeBase() {
- return this.codeBase;
- }
-
- public void add(Permission var1) {
- throw new SecurityException("attempt to add a permission");
- }
-
- private synchronized void init() {
- if (this.perms == null) {
- this.perms = new Permissions();
- this.perms.add(SecurityConstants.CREATE_CLASSLOADER_PERMISSION);
- this.perms.add(new PropertyPermission("java.*", "read"));
- AccessController.doPrivileged(new 1(this));
- }
- }
-
- public boolean implies(Permission var1) {
- if (this.perms == null) {
- this.init();
- }
-
- return this.perms.implies(var1);
- }
-
- public Enumeration elements() {
- if (this.perms == null) {
- this.init();
- }
-
- synchronized(this.perms) {
- return this.perms.elements();
- }
- }
-
- public String toString() {
- if (this.perms == null) {
- this.init();
- }
-
- return this.perms.toString();
- }
-
- // $FF: synthetic method
- static File[] access$000(PathPermissions var0) {
- return var0.path;
- }
-
- // $FF: synthetic method
- static Permissions access$100(PathPermissions var0) {
- return var0.perms;
- }
- }
-