Class DocumentJarClassLoader
java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
org.apache.batik.bridge.DocumentJarClassLoader
- All Implemented Interfaces:
Closeable, AutoCloseable
This
ClassLoader implementation only grants permission to
connect back to the server from where the document referencing the
jar file was loaded.
A URLClassLoader extension is needed in case the user
allows linked jar files to come from a different origin than
the document referencing them.- Version:
- $Id$
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CodeSourceCodeSource for the Document which referenced the Jar file -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected PermissionCollectiongetPermissions(CodeSource codesource) Returns the permissions for the given codesource object.Methods inherited from class URLClassLoader
addURL, close, definePackage, findClass, findResource, findResources, getResourceAsStream, getURLs, newInstance, newInstanceMethods inherited from class SecureClassLoader
defineClass, defineClassMethods inherited from class ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Field Details
-
documentCodeSource
CodeSource for the Document which referenced the Jar file- See Also:
-
-
Constructor Details
-
DocumentJarClassLoader
-
-
Method Details
-
getPermissions
Returns the permissions for the given codesource object. The implementation of this method first gets the permissions granted by the policy, and then adds additional permissions based on the URL of the codesource.Then, if the documentURL passed at construction time is not null, the permissions granted to that URL are added. As a result, the jar file code will only be able to connect to the server which served the document.
- Overrides:
getPermissionsin classURLClassLoader- Parameters:
codesource- the codesource- Returns:
- the permissions granted to the codesource
-