java.util
Class PropertyPermission
java.lang.Object
|
+--java.security.Permission
|
+--java.security.BasicPermission
|
+--java.util.PropertyPermission
This class represents the permission to access and modify a property.
The name is the name of the property, e.g. xxx. You can also
use an asterisk "*" as described in BasicPermission.
The action string is a comma-separated list of keywords. There are
two possible actions:
- read
- Allows to read the property via
System.getProperty
.
- write
- Allows to write the property via
System.setProperty
.
The action string is case insensitive (it is converted to lower case).
Since:Author:See Also:
PropertyPermission
public PropertyPermission(java.lang.String name, java.lang.String actions)
Constructs a PropertyPermission with the specified property. Possible
actions are read and write, comma-separated and case-insensitive.
Parameters:
Throws:
equals
public boolean equals(java.lang.Object obj)
Check to see whether this object is the same as another
PropertyPermission object; this is true if it has the same name and
actions.
Parameters:
Returns:
- true if the two are equivalent
getActions
public String getActions()
Returns the action string. Note that this may differ from the string
given at the constructor: The actions are converted to lowercase and
may be reordered.
Returns:
- one of "read", "write", or "read,write"
hashCode
public int hashCode()
Returns the hash code for this permission. It is equivalent to
getName().hashCode()
.
Returns:
implies
public boolean implies(java.security.Permission p)
Check if this permission implies p. This returns true iff all of
the following conditions are true:
- p is a PropertyPermission
- this.getName() implies p.getName(),
e.g.
java.*
implies java.home
- this.getActions is a subset of p.getActions
Parameters:
Returns:
- true if this permission implies p
newPermissionCollection
public PermissionCollection newPermissionCollection()
Returns a permission collection suitable to take
PropertyPermission objects.
Returns:
- a new empty PermissionCollection
The name is the name of the property, e.g. xxx. You can also use an asterisk "*" as described in BasicPermission.
The action string is a comma-separated list of keywords. There are two possible actions:
System.getProperty
.System.setProperty
.