public class AccessControlException extends SecurityException
AccessController抛出此异常,以指示所请求的访问(对关键系统资源(如文件系统或网络))被拒绝。
否认访问的原因可能有所不同。 例如,所请求的权限可能是不正确的类型,包含无效值,或请求根据安全策略不允许的访问。 这样的信息应该尽可能在抛出异常时给出。
| Constructor and Description |
|---|
AccessControlException(String s)
构造具有
AccessControlException详细消息的AccessControlException。
|
AccessControlException(String s, Permission p)
构造具有
AccessControlException的详细消息的AccessControlException以及引起异常的请求权限。
|
| Modifier and Type | Method and Description |
|---|---|
Permission |
getPermission()
获取与此异常关联的Permission对象,如果没有相应的Permission对象,则为null。
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringpublic AccessControlException(String s)
AccessControlException的详细消息的AccessControlException。
s - 详细信息。
public AccessControlException(String s, Permission p)
AccessControlException的详细消息的AccessControlException以及引起异常的请求权限。
s - 详细信息。
p - 导致异常的权限。
public Permission getPermission()
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.