Microsoft SDK for Java

checkPackageAccess

This method of the StandardSecurityManager Class determines whether access to classes within the specified package is permitted. Package access is denied if a system property of the form package.restrict.access.packagename exists. This method overrides the java.lang.SecurityManager.checkPackageAccess(String) method.

Syntax

public void checkPackageAccess(String pkg);

Note   Because of both the nature of class loaders and the fact that this check is made at load time instead of class resolution time, no specific contextual information can be extrapolated to determine who is attempting to access the specified package. Therefore, this check does not fit into the class-granular permissions model. Its results are based on a global state, so it will always return the same result, independent of the current execution context.

Parameters

pkg The name of the package to which access is being checked.

Exceptions

SecurityException if package access is prohibited.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.