Build 1.0_r1(from source)

java.io
Class FilePermission

java.lang.Object
  extended by java.security.Permission
      extended by java.io.FilePermission
All Implemented Interfaces:
Serializable, Guard

public final class FilePermission
extends Permission
implements Serializable

The class FilePermission is responsible for granting access to files or directories. The FilePermission is made up of a pathname and a set of actions which are valid for the pathname.

The File.separatorChar must be used in all pathnames when constructing a FilePermission. The following descriptions will assume the char is /. A pathname which ends in "/*", implies all the files and directories contained in that directory. If the pathname ends in "/-", it indicates all the files and directories in that directory recursively.

See Also:
Serialized Form

Field Summary
(package private)  int mask
           
 
Constructor Summary
FilePermission(String path, String actions)
          Constructs a new FilePermission with the path and actions specified.
 
Method Summary
 boolean equals(Object obj)
          Check to see if this permission is equal to another.
 String getActions()
          Returns the actions associated with the receiver.
 int hashCode()
          Returns an int representing the hash code value for this FilePermission.
 boolean implies(Permission p)
          Indicates whether the argument permission is implied by the receiver.
(package private)  int impliesMask(Permission p)
          Returns an int describing what masks are implied by a specific permission.
 PermissionCollection newPermissionCollection()
          Returns a new PermissionCollection in which to place FilePermission Objects.
 
Methods inherited from class java.security.Permission
checkGuard, getName, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

mask

transient int mask
Constructor Detail

FilePermission

public FilePermission(String path,
                      String actions)
Constructs a new FilePermission with the path and actions specified.

Parameters:
path - the path to apply the actions to.
actions - the actions for the path. May be any combination of read, write, execute, or delete.
Method Detail

getActions

public String getActions()
Returns the actions associated with the receiver.

Specified by:
getActions in class Permission
Returns:
the actions associated with the receiver.

equals

public boolean equals(Object obj)
Check to see if this permission is equal to another. The two are equal if obj is a FilePermission, they have the same path, and they have the same actions.

Specified by:
equals in class Permission
Parameters:
obj - the object to check equality with.
Returns:
true if the two are equal, false otherwise.
See Also:
Object.hashCode()

implies

public boolean implies(Permission p)
Indicates whether the argument permission is implied by the receiver.

Specified by:
implies in class Permission
Parameters:
p - java.security.Permission the permission to check.
Returns:
true if the argument permission is implied by the receiver, and false if it is not.

impliesMask

int impliesMask(Permission p)
Returns an int describing what masks are implied by a specific permission.

Parameters:
p - the permission
Returns:
the mask applied to the given permission

newPermissionCollection

public PermissionCollection newPermissionCollection()
Returns a new PermissionCollection in which to place FilePermission Objects.

Overrides:
newPermissionCollection in class Permission
Returns:
A new PermissionCollection suitable for storing FilePermission objects.

hashCode

public int hashCode()
Returns an int representing the hash code value for this FilePermission.

Specified by:
hashCode in class Permission
Returns:
int the hash code value for this FilePermission.
See Also:
Permission.equals(java.lang.Object)

Build 1.0_r1(from source)

Please submit a feedback, bug or feature