public class AccessControlException extends SecurityException
这种异常是由AccessController抛出表示请求的访问(一个关键的系统资源,如文件系统或网络)被拒绝。
拒绝访问的原因可能会有所不同。例如,请求的权限可能是一个不正确的类型,包含一个无效的值,或根据安全策略不允许的请求访问。这样的信息应该在可能的时候给出异常被抛出。
Constructor and Description |
---|
AccessControlException(String s)
构建与指定
AccessControlException ,详细信息。
|
AccessControlException(String s, Permission p)
构建与指定的、详细的信息和请求
AccessControlException ,导致异常。
|
Modifier and Type | Method and Description |
---|---|
Permission |
getPermission()
获取与此异常关联的权限对象,或者如果没有相应的权限对象,或为空。
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public AccessControlException(String s)
AccessControlException
,详细信息。
s
-详细信息。
public AccessControlException(String s, Permission p)
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.