Code example for FilePermission

        PermissionCollection pc = ap.getPermissions(new ProtectionDomain(null,null));
        Permission testPerm = new FilePermission("/tmp","read");
     * Simple test of loading a policy file with a single codebase defined that grants specific  
     * FilePermission.  Then test that read and write were granted but delete was not. 
    public void testSingleCodebaseFilePermissionLoader() throws Exception 
        JettyPolicy ap = new JettyPolicy(  MavenTestingUtils.getTestResourceDir("policy-test-2").getAbsolutePath(), evaluator );
Contextual code suggestions in your IDE  Get Codota for Java