List of usage examples for java.lang SecurityManager checkPackageAccess
public void checkPackageAccess(String pkg)
From source file:Main.java
public static void main(String[] args) { System.setProperty("java.security.policy", "file:/C:/java.policy"); SecurityManager sm = new Main(); System.setSecurityManager(sm); sm.checkPackageAccess("java2s.com"); System.out.println("Allowed!"); }