java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
java.lang.SecurityException
java.security.AccessControlException
- 所有已实现的接口:
-
Serializable
@Deprecated(since="17", forRemoval=true) public class AccessControlException extends SecurityException
Deprecated, for removal: This API element is subject to removal in a future version.
This class is only useful in conjunction with the Security Manager, which is deprecated and subject to removal in a future release. Consequently, this class is also deprecated and subject to removal. There is no replacement for the Security Manager or this class.
此异常由AccessController
抛出,表示拒绝对关键系统资源(如文件系统或网络)的请求访问。
拒绝访问的原因可能各不相同。例如,请求的权限可能是错误类型,包含无效值,或者根据安全策略不允许请求访问。应尽可能在抛出异常时提供此类信息。
- 自版本:
- 1.2
- 参见:
-
Constructor Summary
ConstructorDescription已弃用,将来会移除: 此API元素可能会在将来的版本中移除。构造具有指定详细消息的AccessControlException
。已弃用,将来会移除: 此API元素可能会在将来的版本中移除。构造具有指定详细消息和导致异常的请求权限的AccessControlException
。 -
Method Summary
Modifier and TypeMethodDescription已弃用,将来会移除: 此API元素可能会在将来的版本中移除。获取与此异常关联的Permission
对象,如果没有相应的Permission
对象,则返回null
。Methods declared in class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
AccessControlException
Deprecated, for removal: This API element is subject to removal in a future version.构造具有指定详细消息的AccessControlException
。- 参数:
-
s
- 详细消息。
-
AccessControlException
Deprecated, for removal: This API element is subject to removal in a future version.构造具有指定详细消息和导致异常的请求权限的AccessControlException
。- 参数:
-
s
- 详细消息。 -
p
- 导致异常的权限。
-
-
Method Details
-
getPermission
Deprecated, for removal: This API element is subject to removal in a future version.获取与此异常关联的Permission
对象,如果没有相应的Permission
对象,则返回null
。- 返回:
- Permission对象。
-