|
CLDC 1.1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.security.Permission javax.microedition.io.GCFPermission javax.microedition.io.FileProtocolPermission
This class represents access rights to connections via the "file"
protocol. A FileProtocolPermission
consists of a
URI string indicating a fully-qualified, absolute pathname and a set of
actions desired for that pathname.
The URI string takes the following general form:
file:{pathname} | file://[localhost]{pathname}(The exact syntax is given by RFCs 1738 & 2396.) In addition, a pathname that ends in "/*" 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.
The actions to be granted are passed to the constructor in a string containing a list of one or more comma-separated keywords. The possible keywords are "read" and "write". The actions string is converted to lowercase before processing.
Connector.open(java.lang.String)
,
"javax.microedition.io.file.FileConnection" in FileConnection Optional Package SpecificationConstructor Summary | |
FileProtocolPermission(String uri,
String actions)
Creates a new FileProtocolPermission with the specified
actions. |
Method Summary | |
boolean |
equals(Object obj)
Checks two FileProtocolPermission 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 FileProtocolPermission object "implies"
the specified permission. |
PermissionCollection |
newPermissionCollection()
Returns a new PermissionCollection for storing
FileProtocolPermission objects. |
Methods inherited from class javax.microedition.io.GCFPermission |
getProtocol, getURI |
Methods inherited from class java.security.Permission |
getName, toString |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public FileProtocolPermission(String uri, String actions)
FileProtocolPermission
with the specified
actions. The specified URI becomes the name of the
FileProtocolPermission
.
The URI string must conform to the specification given above,
and is
normalized
to facilitate subsequent comparisons.
uri
- the URI stringactions
- comma-separated list of desired actions
IllegalArgumentException
- if uri
or
actions
is malformed.
NullPointerException
- if uri
or
actions
is null
.Permission.getName()
,
getActions()
Method Detail |
public boolean implies(Permission p)
FileProtocolPermission
object "implies"
the specified permission.
More specifically, this method returns true
if:
FileProtocolPermission
,
implies
in class Permission
p
- the permission to check against
public boolean equals(Object obj)
FileProtocolPermission
objects for equality.
equals
in class Permission
obj
- the object we are testing for equality with this object.
true
if obj
is a
FileProtocolPermission
,
and has the same URI string and actions as
this FileProtocolPermission
object.public int hashCode()
hashCode
in class Permission
public String getActions()
"read,write"
.
getActions
in class Permission
public PermissionCollection newPermissionCollection()
PermissionCollection
for storing
FileProtocolPermission
objects.
FileProtocolPermission
objects must be stored in a
manner that allows
them to be inserted into the collection in any order, but that also
enables the PermissionCollection
implies method to be
implemented in an efficient (and consistent) manner.
newPermissionCollection
in class Permission
PermissionCollection
suitable for storing
FileProtocolPermission
objects.
|
CLDC 1.1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |