Code example for Permission

Methods: implies

0
 
    private static class DenyFSA extends Deny { 
        private String err = "sorry - getFileSystemAttributes";
 
        public void checkPermission(Permission p) {
            if (p.implies(new RuntimePermission("getFileSystemAttributes")))
                throw new SecurityException(err);
            super.checkPermission(p);
        } 
 
        public void checkPermission(Permission p, Object context) {
            if (p.implies(new RuntimePermission("getFileSystemAttributes")))
                throw new SecurityException(err);
            super.checkPermission(p, context);
        } 
    } 
 
    private static class DenyRead extends Deny { 
        private String err = "sorry - checkRead()";