test/lib/security/java.policy/Ext_AllPolicy.java

Print this page

        

*** 33,41 **** --- 33,46 ---- public static void main (String[] args) { FilePermission mine = new FilePermission("/tmp/bar", "read"); SecurityManager sm = System.getSecurityManager(); if (sm != null) { + try { sm.checkPermission(mine); + throw new RuntimeException(mine + " expected to deny access"); + } catch (AccessControlException e) { + // Default has no privilege. + } } } }