public final class AccessController extends Object
The AccessController class is used for access control operations and decisions.
More specifically, the AccessController class is used to decide whether an access to a critical system resource is to be allowed or denied, based on the security policy currently in effect.
determines whether the access request indicated by a specified
permission should be granted or denied. A sample call appears
below. In this example,
checkPermission will determine
whether or not to grant "read" access to the file named "testFile" in
the "/temp" directory.
FilePermission perm = new FilePermission("/temp/testFile", "read"); AccessController.checkPermission(perm);
If a requested access is allowed,
checkPermission returns quietly. If denied, an
thrown. AccessControlException can also be thrown if the requested
permission is of an incorrect type or contains an invalid value.
Such information is given whenever possible.
|Modifier and Type||Method and Description|
Determines whether the access request indicated by the specified permission should be allowed or denied, based on the security policy.
public static void checkPermission(Permission perm) throws AccessControlException
Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. Use of this specification is subject to license terms.