Top Description Fields Constructors Methods
java.io

pack-priv final Class FilePermissionCollection

Located in compilation unit of java.io.FilePermission.

extends PermissionCollection
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.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:
  1. "/tmp/-", "read"
  2. "/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".
Authors
Marianne Mueller, Roland Schemers
See Also
java.security.Permission, java.security.Permissions, java.security.PermissionCollection

Field Summary

Modifier and TypeField and Description
private transient ConcurrentHashMap<String, Permission>
private static final ObjectStreamField[]
private static final long

Constructor Summary

AccessConstructor and Description
public
FilePermissionCollection()

Create an empty FilePermissionCollection object.

Method Summary

Modifier and TypeMethod and Description
public void
add(Permission
the Permission object to add.
permission
)

Implements abstract java.security.PermissionCollection.add.

Adds a permission to the FilePermissionCollection.

public Enumeration<Permission>

Returns:

an enumeration of all the FilePermission objects.
elements
()

Implements abstract java.security.PermissionCollection.elements.

Returns an enumeration of all the FilePermission objects in the container.

public boolean

Returns:

true if "permission" is a proper subset of a permission in the set, false if not.
implies
(Permission
the Permission object to compare
permission
)

Implements abstract java.security.PermissionCollection.implies.

Check and see if this set of permissions implies the permissions expressed in "permission".

private void
readObject(ObjectInputStream
the ObjectInputStream from which data is read
in
)

Reads in a Vector of FilePermissions and saves them in the perms field.

private void
writeObject(ObjectOutputStream
the ObjectOutputStream to which data is written
out
)

Writes the contents of the perms field out as a Vector for serialization compatibility with earlier releases.

Inherited from java.security.PermissionCollection:
elementsAsStreamisReadOnlysetReadOnlytoString

Field Detail

permsback to summary
private transient ConcurrentHashMap<String, Permission> perms
serialPersistentFieldsback to summary
private static final ObjectStreamField[] serialPersistentFields
Annotations
@Serial
Serial Fields:
permissions:Vector
A list of FilePermission objects.
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.security.PermissionCollection.serialVersionUID.

Annotations
@Serial

Constructor Detail

FilePermissionCollectionback to summary
public FilePermissionCollection()

Create an empty FilePermissionCollection object.

Method Detail

addback to summary
public void add(Permission permission)

Implements abstract java.security.PermissionCollection.add.

Adds a permission to the FilePermissionCollection. The key for the hash is permission.path.

Parameters
permission:Permission

the Permission object to add.

Annotations
@Override
Exceptions
IllegalArgumentException:
if the permission is not a FilePermission
SecurityException:
if this FilePermissionCollection object has been marked readonly
elementsback to summary
public Enumeration<Permission> elements()

Implements abstract java.security.PermissionCollection.elements.

Returns an enumeration of all the FilePermission objects in the container.

Returns:Enumeration<Permission>

an enumeration of all the FilePermission objects.

Annotations
@Override
impliesback to summary
public boolean implies(Permission permission)

Implements abstract java.security.PermissionCollection.implies.

Check and see if this set of permissions implies the permissions expressed in "permission".

Parameters
permission:Permission

the Permission object to compare

Returns:boolean

true if "permission" is a proper subset of a permission in the set, false if not.

Annotations
@Override
readObjectback to summary
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException

Reads in a Vector of FilePermissions and saves them in the perms field.

Parameters
in:ObjectInputStream

the ObjectInputStream from which data is read

Annotations
@Serial
Exceptions
IOException:
if an I/O error occurs
ClassNotFoundException:
if a serialized class cannot be loaded
writeObjectback to summary
private void writeObject(ObjectOutputStream out) throws IOException

Writes the contents of the perms field out as a Vector for serialization compatibility with earlier releases.

Parameters
out:ObjectOutputStream

the ObjectOutputStream to which data is written

Annotations
@Serial
Exceptions
IOException:
if an I/O error occurs