java.io
Class FilePermissionCollection
java.lang.Object
|
+--java.security.PermissionCollection
|
+--java.io.FilePermissionCollection
- final class FilePermissionCollection
- extends java.security.PermissionCollection
- implements Serializable
A FilePermissionCollection stores a set of FilePermission permissions.
FilePermission objects
must be stored in a manner that allows them to be inserted in any
order, but enable the implies function to evaluate the implies
method.
For example, if you have two FilePermissions:
- "/tmp/-", "read"
- "/tmp/scratch/foo", "write"
And you are calling the implies function with the FilePermission:
"/tmp/scratch/foo", "read,write", then the implies function must
take into account both the /tmp/- and /tmp/scratch/foo
permissions, so the effective permission is "read,write".
- See Also:
Permission
,
java.security.Permissions
,
PermissionCollection
, Serialized Form
Fields inherited from class java.security.PermissionCollection |
readOnly |
Method Summary |
void |
add(java.security.Permission permission)
Adds a permission to the FilePermissions. |
Enumeration |
elements()
Returns an enumeration of all the FilePermission objects in the
container. |
boolean |
implies(java.security.Permission permission)
Check and see if this set of permissions implies the permissions
expressed in "permission". |
Methods inherited from class java.security.PermissionCollection |
isReadOnly,
setReadOnly,
toString |
Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
wait,
wait,
wait |
permissions
private Vector permissions
FilePermissionCollection
public FilePermissionCollection()
- Create an empty FilePermissions object.
add
public void add(java.security.Permission permission)
- Adds a permission to the FilePermissions. The key for the hash is
permission.path.
- Parameters:
permission
- the Permission object to add.- Overrides:
- add in class java.security.PermissionCollection
implies
public boolean implies(java.security.Permission permission)
- Check and see if this set of permissions implies the permissions
expressed in "permission".
- Parameters:
p
- the Permission object to compare- Returns:
- true if "permission" is a proper subset of a permission in
the set, false if not.
- Overrides:
- implies in class java.security.PermissionCollection
elements
public Enumeration elements()
- Returns an enumeration of all the FilePermission objects in the
container.
- Returns:
- an enumeration of all the FilePermission objects.
- Overrides:
- elements in class java.security.PermissionCollection