public class DocumentJarClassLoader extends URLClassLoader
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.| Modifier and Type | Field and Description |
|---|---|
protected CodeSource |
documentCodeSource
CodeSource for the Document which referenced the Jar file
|
| Constructor and Description |
|---|
DocumentJarClassLoader(URL jarURL,
URL documentURL)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected PermissionCollection |
getPermissions(CodeSource codesource)
Returns the permissions for the given codesource object.
|
addURL, close, definePackage, findClass, findResource, findResources, getResourceAsStream, getURLs, newInstance, newInstancedefineClass, defineClassclearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSignersprotected CodeSource documentCodeSource
getPermissions(java.security.CodeSource)protected PermissionCollection getPermissions(CodeSource 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.
getPermissions in class URLClassLoadercodesource - the codesourceCopyright © 2000–2020 Apache Software Foundation. All rights reserved.