public final class HttpProtocolPermission extends GCFPermission
HttpProtocolPermission
consists of a
URI string but no actions list.
The URI string specifies a data resource accessible via http. It takes the following form:
http://{host}[:{portrange}][{pathname}]If the
{host}
string is a DNS name, an asterisk may
appear in the leftmost position to indicate a wildcard match
(e.g., "*.sun.com").
The {portrange}
string takes the following form:
portnumber | -portnumber | portnumber-[portnumber]A
{portrange}
specification of the form "N-"
(where N is a port number)
signifies all ports numbered N and above, while a specification of the
form "-N" indicates all ports numbered N and below.Connector.open(java.lang.String)
,
"javax.microedition.io.HttpConnection" in MIDP 3.0 SpecificationConstructor and Description |
---|
HttpProtocolPermission(String uri)
Creates a new
HttpProtocolPermission with the
specified URI as its name. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Checks two
HttpProtocolPermission objects for equality. |
String |
getActions()
Returns the canonical string representation of the actions, which
currently is the empty string "", since there are no actions defined
for
HttpProtocolPermission . |
int |
hashCode()
Returns the hash code value for this object.
|
boolean |
implies(Permission p)
Checks if this
HttpProtocolPermission object "implies"
the specified permission. |
PermissionCollection |
newPermissionCollection()
Returns a new
PermissionCollection for storing
HttpProtocolPermission objects. |
getProtocol, getURI
getName, toString
public HttpProtocolPermission(String uri)
HttpProtocolPermission
with the
specified URI as its name. The URI string must conform to the
specification given above.uri
- the URI string.IllegalArgumentException
- if uri
is malformed.NullPointerException
- if uri
is null
.Permission.getName()
public boolean implies(Permission p)
HttpProtocolPermission
object "implies"
the specified permission.
More specifically, this method first ensures that all of the following are true (and returns false if any of them are not):
Then implies
checks each of the following, in order,
and for each returns true if the stated condition is true:
implies
returns false.
Note that the {pathname}
component is not used when
evaluating the 'implies' relation.
implies
in class Permission
p
- the permission to check against.public boolean equals(Object obj)
HttpProtocolPermission
objects for equality.equals
in class Permission
obj
- the object we are testing for equality with this object.true
if obj
is a
HttpProtocolPermission
and has the same URI string as
this HttpProtocolPermission
object.Boolean.hashCode()
,
Hashtable
public int hashCode()
hashCode
in class Permission
Object.equals(java.lang.Object)
,
Hashtable
public String getActions()
HttpProtocolPermission
.getActions
in class Permission
public PermissionCollection newPermissionCollection()
PermissionCollection
for storing
HttpProtocolPermission
objects.
HttpProtocolPermission
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
HttpProtocolPermission
objects.