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.
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.
pkg | The name of the package to which access is being checked. |
SecurityException if package access is prohibited.