Top Description Fields Constructors Methods
java.security

public Class AccessControlException

extends SecurityException
Class Inheritance
Annotations
@Deprecated
since:17
forRemoval:true

Deprecated

for removal since 17.

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.

This exception is thrown by the AccessController to indicate that a requested access (to a critical system resource such as the file system or the network) is denied.

The reason to deny access can vary. For example, the requested permission might be of an incorrect type, contain an invalid value, or request access that is not allowed according to the security policy. Such information should be given whenever possible at the time the exception is thrown.

Authors
Li Gong, Roland Schemers
Since
1.2

Field Summary

Modifier and TypeField and Description
private Permission
perm

The permission that caused the exception to be thrown.

private static final long

Constructor Summary

AccessConstructor and Description
public
AccessControlException(String
the detail message.
s
)

Constructs an AccessControlException with the specified, detailed message.

public
AccessControlException(String
the detail message.
s
,
Permission
the permission that caused the exception.
p
)

Constructs an AccessControlException with the specified, detailed message, and the requested permission that caused the exception.

Method Summary

Modifier and TypeMethod and Description
public Permission

Returns:

the Permission object.
getPermission
()

Gets the Permission object associated with this exception, or null if there was no corresponding Permission object.

Field Detail

permback to summary
private Permission perm

The permission that caused the exception to be thrown.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.lang.SecurityException.serialVersionUID.

Annotations
@Serial

Constructor Detail

AccessControlExceptionback to summary
public AccessControlException(String s)

Constructs an AccessControlException with the specified, detailed message.

Parameters
s:String

the detail message.

AccessControlExceptionback to summary
public AccessControlException(String s, Permission p)

Constructs an AccessControlException with the specified, detailed message, and the requested permission that caused the exception.

Parameters
s:String

the detail message.

p:Permission

the permission that caused the exception.

Method Detail

getPermissionback to summary
public Permission getPermission()

Gets the Permission object associated with this exception, or null if there was no corresponding Permission object.

Returns:Permission

the Permission object.