Code example for Permission

Methods: getName

0
                throw new SecurityException("permission is not allowed");
            } 
        } 
 
        public void checkPermission(Permission permission) {
            if ("setSecurityManager".equals(permission.getName())) {
                return; 
            } 
            super.checkPermission(permission);
        } 
 
    } 
 
 
    static class MyURLStreamHandler extends URLStreamHandler {
 
        @Override 
        protected URLConnection openConnection(URL arg0) throws IOException {
            try { 
                URLConnection con = arg0.openConnection();
                con.setDoInput(true);