java.io
Class FilePermissionCollection
java.lang.Object
java.security.PermissionCollection
java.io.FilePermissionCollection
- All Implemented Interfaces:
- Serializable
- 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".
- Author:
- Marianne Mueller, Roland Schemers
- See Also:
Permission
,
Permissions
,
PermissionCollection
,
Serialized Form
Fields inherited from class java.security.PermissionCollection |
|
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". |
private void |
readObject(ObjectInputStream in)
|
private void |
writeObject(ObjectOutputStream out)
|
Methods inherited from class java.security.PermissionCollection |
isReadOnly, setReadOnly, toString |
perms
private transient List perms
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
serialPersistentFields
private static final ObjectStreamField[] serialPersistentFields
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.
- Throws:
IllegalArgumentException
- - if the permission is not a
FilePermission
SecurityException
- - if this FilePermissionCollection object
has been marked readonly
implies
public boolean implies(java.security.Permission permission)
- Check and see if this set of permissions implies the permissions
expressed in "permission".
- Returns:
- true if "permission" is a proper subset of a permission in
the set, false if not.
elements
public Enumeration elements()
- Returns an enumeration of all the FilePermission objects in the
container.
- Returns:
- an enumeration of all the FilePermission objects.
writeObject
private void writeObject(ObjectOutputStream out)
throws IOException
- Throws:
IOException
readObject
private void readObject(ObjectInputStream in)
throws IOException,
ClassNotFoundException
- Throws:
IOException
ClassNotFoundException