java.net.SocketPermission
This class represents access to a network via sockets. A SocketPermission consists of a host specification and a set of "actions" specifying ways to connect to that host. The host is specified as
host = (hostname | IPv4address | iPv6reference) [:portrange]
portrange = portnumber | -portnumber | portnumber-[portnumber]
The host is expressed as a DNS name, as a numerical IP address, or as "localhost" (for the local machine). The wildcard "*" may be included once in a DNS name host specification. If it is included, it must be in the leftmost position, as in "*.example.com".
Some methods of SocketPermission class
SocketPermission(String, String): This method creates a new SocketPermission object with the specified actions. The host is expressed as a DNS name, or as a numerical IP address.
equals(Object): This method checks two SocketPermission objects for equality.
getActions(): This method returns the canonical string representation of the actions. Always returns present actions in the following order: connect, listen, accept, resolve.
hashCode(): This method returns the hash code value for this object.
implies(Permission): This method checks if this socket permission object "implies" the specified permission.
newPermissionCollection(): This method returns a new PermissionCollection object for storing SocketPermission objects.
No comments:
Post a Comment