List of usage examples for java.util PropertyPermission newPermissionCollection
@Override
public PermissionCollection newPermissionCollection()
From source file:Main.java
public static void main(String[] args) { // Build property permissions collection PropertyPermission permission = new PropertyPermission("java.*", "read"); PermissionCollection permissions = permission.newPermissionCollection(); permissions.add(permission);// ww w.j a v a 2s . c o m permissions.add(new PropertyPermission("java.home.*", "read,write")); if (permissions.implies(new PropertyPermission("java.home", "read"))) { System.out.println("Has permissions on " + "java.home" + " for read"); } if (permissions.implies(new PropertyPermission("java.home", "write"))) { System.out.println("Has permissions on " + "java.home" + " for write"); } }