private void initializeStaticPolicy(List<ProGradePolicyEntry> grantEntriesList) throws Exception {

        // grant codeBase "file:${{java.ext.dirs}}/*" {
        // permission java.security.AllPermission;
        // };
        ProGradePolicyEntry p1 = new ProGradePolicyEntry(true, debug);
        Certificate[] certificates = null;
        URL url = new URL(expandStringWithProperty("file:${{java.ext.dirs}}/*"));
        CodeSource cs = new CodeSource(adaptURL(url), certificates);
        p1.setCodeSource(cs);
        p1.addPermission(new AllPermission());
        grantEntriesList.add(p1);

        // grant {
        // permission java.lang.RuntimePermission "stopThread";
        // permission java.net.SocketPermission "localhost:1024-", "listen";
        // permission java.util.PropertyPermission "java.version", "read";
        // permission java.util.PropertyPermission "java.vendor", "read";
        // permission java.util.PropertyPermission "java.vendor.url", "read";
        // permission java.util.PropertyPermission "java.class.version", "read";
        // permission java.util.PropertyPermission "os.name", "read";
        // permission java.util.PropertyPermission "os.version", "read";
        // permission java.util.PropertyPermission "os.arch", "read";
        // permission java.util.PropertyPermission "file.separator", "read";
        // permission java.util.PropertyPermission "path.separator", "read";
        // permission java.util.PropertyPermission "line.separator", "read";
        // permission java.util.PropertyPermission "java.specification.version", "read";
        // permission java.util.PropertyPermission "java.specification.vendor", "read";
        // permission java.util.PropertyPermission "java.specification.name", "read";
        // permission java.util.PropertyPermission "java.vm.specification.version", "read";
        // permission java.util.PropertyPermission "java.vm.specification.vendor", "read";
        // permission java.util.PropertyPermission "java.vm.specification.name", "read";
        // permission java.util.PropertyPermission "java.vm.version", "read";
        // permission java.util.PropertyPermission "java.vm.vendor", "read";
        // permission java.util.PropertyPermission "java.vm.name", "read";
        // };
        ProGradePolicyEntry p2 = new ProGradePolicyEntry(true, debug);
        p2.addPermission(new RuntimePermission("stopThread"));
        p2.addPermission(new SocketPermission("localhost:1024-", "listen"));
        p2.addPermission(new PropertyPermission("java.version", "read"));
        p2.addPermission(new PropertyPermission("java.vendor", "read"));
        p2.addPermission(new PropertyPermission("java.vendor.url", "read"));
        p2.addPermission(new PropertyPermission("java.class.version", "read"));
        p2.addPermission(new PropertyPermission("os.name", "read"));
        p2.addPermission(new PropertyPermission("os.version", "read"));
        p2.addPermission(new PropertyPermission("os.arch", "read"));
        p2.addPermission(new PropertyPermission("file.separator", "read"));
        p2.addPermission(new PropertyPermission("path.separator", "read"));
        p2.addPermission(new PropertyPermission("line.separator", "read"));
        p2.addPermission(new PropertyPermission("java.specification.version", "read"));
        p2.addPermission(new PropertyPermission("java.specification.vendor", "read"));
        p2.addPermission(new PropertyPermission("java.specification.name", "read"));
        p2.addPermission(new PropertyPermission("java.vm.specification.version", "read"));
        p2.addPermission(new PropertyPermission("java.vm.specification.vendor", "read"));
        p2.addPermission(new PropertyPermission("java.vm.specification.name", "read"));
        p2.addPermission(new PropertyPermission("java.vm.version", "read"));
        p2.addPermission(new PropertyPermission("java.vm.vendor", "read"));
        p2.addPermission(new PropertyPermission("java.vm.name", "read"));
        grantEntriesList.add(p2);

    }
private void initializeStaticPolicy ( List < ProGradePolicyEntry > grantEntriesList ) throws Exception { ProGradePolicyEntry p1 = new ProGradePolicyEntry ( true , debug ) ; Certificate [ ] certificates = null ; URL url = new URL ( expandStringWithProperty ( "file:${{java.ext.dirs}}/*" ) ) ; CodeSource cs = new CodeSource ( adaptURL ( url ) , certificates ) ; p1 . setCodeSource ( cs ) ; p1 . addPermission ( new AllPermission ( ) ) ; grantEntriesList . add ( p1 ) ; ProGradePolicyEntry p2 = new ProGradePolicyEntry ( true , debug ) ; p2 . addPermission ( new RuntimePermission ( "stopThread" ) ) ; p2 . addPermission ( new SocketPermission ( "localhost:1024-" , "listen" ) ) ; p2 . addPermission ( new PropertyPermission ( "java.version" , "read" ) ) ; p2 . addPermission ( new PropertyPermission ( "java.vendor" , "read" ) ) ; p2 . addPermission ( new PropertyPermission ( "java.vendor.url" , "read" ) ) ; p2 . addPermission ( new PropertyPermission ( "java.class.version" , "read" ) ) ; p2 . addPermission ( new PropertyPermission ( "os.name" , "read" ) ) ; p2 . addPermission ( new PropertyPermission ( "os.version" , "read" ) ) ; p2 . addPermission ( new PropertyPermission ( "os.arch" , "read" ) ) ; p2 . addPermission ( new PropertyPermission ( "file.separator" , "read" ) ) ; p2 . addPermission ( new PropertyPermission ( "path.separator" , "read" ) ) ; p2 . addPermission ( new PropertyPermission ( "line.separator" , "read" ) ) ; p2 . addPermission ( new PropertyPermission ( "java.specification.version" , "read" ) ) ; p2 . addPermission ( new PropertyPermission ( "java.specification.vendor" , "read" ) ) ; p2 . addPermission ( new PropertyPermission ( "java.specification.name" , "read" ) ) ; p2 . addPermission ( new PropertyPermission ( "java.vm.specification.version" , "read" ) ) ; p2 . addPermission ( new PropertyPermission ( "java.vm.specification.vendor" , "read" ) ) ; p2 . addPermission ( new PropertyPermission ( "java.vm.specification.name" , "read" ) ) ; p2 . addPermission ( new PropertyPermission ( "java.vm.version" , "read" ) ) ; p2 . addPermission ( new PropertyPermission ( "java.vm.vendor" , "read" ) ) ; p2 . addPermission ( new PropertyPermission ( "java.vm.name" , "read" ) ) ; grantEntriesList . add ( p2 ) ; }
Private method for initializing static policy.

@throws Exception when there was any problem during initializing static policy