Code example for Permission

Methods: getActions

0
        } 
    } 
 
    class MockSecurityManager extends SecurityManager {
        public void checkPermission(Permission p) {
            if (p.getActions().equals("write") && p instanceof FilePermission) {
                throw new SecurityException("Always throw security exception");
            } 
        } 
 
        public void checkPermission(Permission p, Object ctx) {
            checkPermission(p);
        } 
    } 
 
    class MockFormattable implements Formattable {
        public void formatTo(Formatter formatter, int flags, int width,
                int precision) throws IllegalFormatException {
            if ((flags & FormattableFlags.UPPERCASE) != 0) {
                formatter.format("CUSTOMIZED FORMAT FUNCTION" + " WIDTH: "
                        + width + " PRECISION: " + precision);