| |
|
| java.lang.Object org.apache.batik.util.ApplicationSecurityEnforcer
ApplicationSecurityEnforcer | public class ApplicationSecurityEnforcer (Code) | | This is a helper class which helps applications enforce secure
script execution.
It is used by the Squiggle browser as well as the rasterizer.
This class can install a SecurityManager for an application
and resolves whether the application runs in a development
environment or from a jar file (in other words, it resolves code-base
issues for the application).
author: Vincent Hardy version: $Id$ |
Constructor Summary | |
public | ApplicationSecurityEnforcer(Class appMainClass, String securityPolicy, String appJarFile) Parameters: appClass - class of the applications's main entry point Parameters: securityPolicy - resource for the security policy which should be enforced for the application. | public | ApplicationSecurityEnforcer(Class appMainClass, String securityPolicy) Parameters: appClass - class of the applications's main entry point Parameters: securityPolicy - resource for the security policy which should be enforced for the application. |
Method Summary | |
public void | enforceSecurity(boolean enforce) Enforces security by installing a SecurityManager.
This will throw a SecurityException if installing
a SecurityManager requires overriding an existing
SecurityManager. | public URL | getPolicyURL() Returns the url for the default policy. | public void | installSecurityManager() |
APP_MAIN_CLASS_DIR | final public static String APP_MAIN_CLASS_DIR(Code) | | Directory where classes are expanded in the development
version
|
EXCEPTION_ALIEN_SECURITY_MANAGER | final public static String EXCEPTION_ALIEN_SECURITY_MANAGER(Code) | | Message for the SecurityException thrown when there is already
a SecurityManager installed at the time Squiggle tries
to install its own security settings.
|
EXCEPTION_NO_POLICY_FILE | final public static String EXCEPTION_NO_POLICY_FILE(Code) | | Message for the NullPointerException thrown when no policy
file can be found.
|
JAR_PROTOCOL | final public static String JAR_PROTOCOL(Code) | | Files in a jar file have a URL with the jar protocol
|
JAR_URL_FILE_SEPARATOR | final public static String JAR_URL_FILE_SEPARATOR(Code) | | Used in jar file urls to separate the jar file name
from the referenced file
|
PROPERTY_APP_DEV_BASE | final public static String PROPERTY_APP_DEV_BASE(Code) | | System property for App's development base directory
|
PROPERTY_APP_JAR_BASE | final public static String PROPERTY_APP_JAR_BASE(Code) | | System property for App's jars base directory
|
PROPERTY_JAVA_SECURITY_POLICY | final public static String PROPERTY_JAVA_SECURITY_POLICY(Code) | | System property for specifying an additional policy file.
|
appMainClass | protected Class appMainClass(Code) | | The application's main entry point
|
appMainClassRelativeURL | protected String appMainClassRelativeURL(Code) | | The resource name for the application's main class
|
lastSecurityManagerInstalled | protected BatikSecurityManager lastSecurityManagerInstalled(Code) | | Keeps track of the last SecurityManager installed
|
securityPolicy | protected String securityPolicy(Code) | | The application's security policy
|
ApplicationSecurityEnforcer | public ApplicationSecurityEnforcer(Class appMainClass, String securityPolicy, String appJarFile)(Code) | | Parameters: appClass - class of the applications's main entry point Parameters: securityPolicy - resource for the security policy which should be enforced for the application. Parameters: appJarFile - the Jar file into which the application ispackaged. |
ApplicationSecurityEnforcer | public ApplicationSecurityEnforcer(Class appMainClass, String securityPolicy)(Code) | | Parameters: appClass - class of the applications's main entry point Parameters: securityPolicy - resource for the security policy which should be enforced for the application. |
enforceSecurity | public void enforceSecurity(boolean enforce)(Code) | | Enforces security by installing a SecurityManager.
This will throw a SecurityException if installing
a SecurityManager requires overriding an existing
SecurityManager. In other words, this method will
not install a new SecurityManager if there is
already one it did not install in place.
|
getPolicyURL | public URL getPolicyURL()(Code) | | Returns the url for the default policy. This never
returns null, but it may throw a NullPointerException
|
installSecurityManager | public void installSecurityManager()(Code) | | Installs a SecurityManager on behalf of the application
|
|
|
|