List of usage examples for java.security GuardedObject getObject
public Object getObject() throws SecurityException
From source file:Main.java
public static void main(String[] argv) throws Exception { String secretObj = "secret"; Guard guard = new PropertyPermission("java.home", "read"); GuardedObject gobj = new GuardedObject(secretObj, guard); try {/*w ww. ja va 2 s . com*/ Object o = gobj.getObject(); } catch (AccessControlException e) { e.printStackTrace(); } }