The following features are supported:
java.io.FilePermissionobjects are added to an instance of this class, they are all stored in a single PermissionCollection. It is the PermissionCollection returned by a call to the
newPermissionCollectionmethod in the FilePermission class. Similarly, any
java.lang.RuntimePermissionobjects are stored in the PermissionCollection returned by a call to the
newPermissionCollectionmethod in the RuntimePermission class. Thus, this class represents a collection of PermissionCollections.
add method is called to add a Permission, the Permission is stored in the appropriate PermissionCollection. If no such collection exists yet, the Permission object's class is determined and the
newPermissionCollection method is called on that class to create the PermissionCollection and add it to the Permissions object. If
newPermissionCollection returns null, then a default PermissionCollection that uses a hashtable will be created and used. Each hashtable entry stores a Permission object as both the key and the value.
Enumerations returned via the
elements method are not fail-fast. Modifications to a collection should not be performed while enumerating over that collection.
@version 1.61, 05/11/17
@author Marianne Mueller
@author Roland Schemers
The permissions are implemented using two EnumSet of Permission instances: one set for the permissions that have been explicitly allowed, and one set for the permissions that have been explicitly denied. A denied permission takes percedence over an allowed permission.
This permission system is modelled after Windows. @author Torgil Zethson