public final class

ExecPermission

extends Permission
java.lang.Object
   ↳ java.security.Permission
     ↳ com.sun.rmi.rmid.ExecPermission

Class Overview

The ExecPermission class represents permission for rmid to execute a specific command to launch an activation group. An ExecPermission consists of a pathname of a command to launch an activation group.

Pathname is the pathname of the file or directory to grant rmid execute permission. A pathname that ends in "/*" (where "/" is the file separator character, File.separatorChar) indicates all the files and directories contained in that directory. A pathname that ends with "/-" indicates (recursively) all files and subdirectories contained in that directory. A pathname consisting of the special token "<<ALL FILES>>" matches any file.

Note: A pathname consisting of a single "*" indicates all the files in the current directory, while a pathname consisting of a single "-" indicates all the files in the current directory and (recursively) all files and subdirectories contained in the current directory.

Summary

Public Constructors
ExecPermission(String path)
Creates a new ExecPermission object with the specified path.
ExecPermission(String path, String actions)
Creates a new ExecPermission object with the specified path.
Public Methods
boolean equals(Object obj)
Checks two ExecPermission objects for equality.
String getActions()
Returns the canonical string representation of the actions.
int hashCode()
Returns the hash code value for this object.
boolean implies(Permission p)
Checks if this ExecPermission object "implies" the specified permission.
PermissionCollection newPermissionCollection()
Returns a new PermissionCollection object for storing ExecPermission objects.
[Expand]
Inherited Methods
From class java.security.Permission
From class java.lang.Object
From interface java.security.Guard

Public Constructors

public ExecPermission (String path)

Creates a new ExecPermission object with the specified path. path is the pathname of a file or directory.

A pathname that ends in "/*" (where "/" is the file separator character, File.separatorChar) indicates a directory and all the files contained in that directory. A pathname that ends with "/-" indicates a directory and (recursively) all files and subdirectories contained in that directory. The special pathname "<<ALL FILES>>" matches all files.

A pathname consisting of a single "*" indicates all the files in the current directory, while a pathname consisting of a single "-" indicates all the files in the current directory and (recursively) all files and subdirectories contained in the current directory.

Parameters
path the pathname of the file/directory.

public ExecPermission (String path, String actions)

Creates a new ExecPermission object with the specified path. path is the pathname of a file or directory.

A pathname that ends in "/*" (where "/" is the file separator character, File.separatorChar) indicates a directory and all the files contained in that directory. A pathname that ends with "/-" indicates a directory and (recursively) all files and subdirectories contained in that directory. The special pathname "<<ALL FILES>>" matches all files.

A pathname consisting of a single "*" indicates all the files in the current directory, while a pathname consisting of a single "-" indicates all the files in the current directory and (recursively) all files and subdirectories contained in the current directory.

Parameters
path the pathname of the file/directory.
actions the action string (unused)

Public Methods

public boolean equals (Object obj)

Checks two ExecPermission objects for equality. Checks that obj's class is the same as this object's class and has the same name as this object.

Parameters
obj the object we are testing for equality with this object.
Returns
  • true if obj is an ExecPermission, and has the same pathname as this ExecPermission object, false otherwise.

public String getActions ()

Returns the canonical string representation of the actions.

Returns
  • the canonical string representation of the actions.

public int hashCode ()

Returns the hash code value for this object.

Returns
  • a hash code value for this object.

public boolean implies (Permission p)

Checks if this ExecPermission object "implies" the specified permission.

More specifically, this method returns true if:

  • p is an instanceof ExecPermission,

    and

  • p's pathname is implied by this object's pathname. For example, "/tmp/*" implies "/tmp/foo", since "/tmp/*" encompasses the "/tmp" directory and all files in that directory, including the one named "foo".

Parameters
p the permission to check against.
Returns
  • true if the specified permission is implied by this object, false if not.

public PermissionCollection newPermissionCollection ()

Returns a new PermissionCollection object for storing ExecPermission objects.

A ExecPermissionCollection stores a collection of ExecPermission permissions.

ExecPermission objects must be stored in a manner that allows them to be inserted in any order, but that also enables the PermissionCollection implies method to be implemented in an efficient (and consistent) manner.

Returns
  • a new PermissionCollection object suitable for storing ExecPermissions.