Code example for Permission

Methods: getActions

0
} 
 
class MockSecurityManager extends SecurityManager {
    public void checkPermission(Permission permission) {
        if (permission instanceof FilePermission) {
            if (permission.getActions().indexOf("read") == 0)
                throw new SecurityException();
        } 
    } 
 
    public void checkRead(String file) {
        if (null == file) {
            file = "";
        } 
        checkPermission(new FilePermission(file, "read"));
    } 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE