37 |
|
|
38 |
package java.net; |
package java.net; |
39 |
|
|
40 |
|
import java.io.Serializable; |
41 |
import java.security.Permission; |
import java.security.Permission; |
42 |
import java.security.PermissionCollection; |
import java.security.PermissionCollection; |
43 |
|
|
88 |
* SocketPermission("www.urbanophile.com:80", "connect,accept"); |
* SocketPermission("www.urbanophile.com:80", "connect,accept"); |
89 |
* Can connect to or accept connections from www.urbanophile.com on port 80 |
* Can connect to or accept connections from www.urbanophile.com on port 80 |
90 |
* SocketPermission("localhost:1024-", "listen,accept,connect"); |
* SocketPermission("localhost:1024-", "listen,accept,connect"); |
91 |
* Can connect to, accept from, an listen on any local port number 1024 and up. |
* Can connect to, accept from, an listen on any local port number 1024 |
92 |
|
* and up. |
93 |
* SocketPermission("*.edu", "connect"); |
* SocketPermission("*.edu", "connect"); |
94 |
* Can connect to any host in the edu domain |
* Can connect to any host in the edu domain |
95 |
* SocketPermission("197.197.20.1", "accept"); |
* SocketPermission("197.197.20.1", "accept"); |
101 |
* @author Aaron M. Renn (arenn@urbanophile.com) |
* @author Aaron M. Renn (arenn@urbanophile.com) |
102 |
*/ |
*/ |
103 |
public final class SocketPermission extends Permission |
public final class SocketPermission extends Permission |
104 |
implements java.io.Serializable |
implements Serializable |
105 |
{ |
{ |
106 |
|
static final long serialVersionUID = -7204263841984476862L; |
107 |
|
|
108 |
// FIXME: Needs serialization work, including readObject/writeObject methods. |
// FIXME: Needs serialization work, including readObject/writeObject methods. |
109 |
/** |
/** |
121 |
* specified host/port combination and actions string. |
* specified host/port combination and actions string. |
122 |
* |
* |
123 |
* @param hostport The hostname/port number combination |
* @param hostport The hostname/port number combination |
124 |
* @param perms The actions string |
* @param actions The actions string |
125 |
*/ |
*/ |
126 |
public SocketPermission(String hostport, String actions) |
public SocketPermission(String hostport, String actions) |
127 |
{ |
{ |
244 |
* <p><ul> |
* <p><ul> |
245 |
* <li>The argument's hostname or IP address is equal to this object's. |
* <li>The argument's hostname or IP address is equal to this object's. |
246 |
* <li>The argument's canonical hostname is equal to this object's. |
* <li>The argument's canonical hostname is equal to this object's. |
247 |
* <li>The argument's canonical name matches this domains hostname with wildcards |
* <li>The argument's canonical name matches this domains hostname with |
248 |
|
* wildcards |
249 |
* </ul> |
* </ul> |
250 |
* |
* |
251 |
* @param perm The Permission to check against |
* @param perm The Permission to check against |