Class ScriptSandbox.FilteringClassLoader
java.lang.Object
java.lang.ClassLoader
de.luckymcdev.foundryengine.common.script.ScriptSandbox.FilteringClassLoader
- Enclosing class:
ScriptSandbox
A class loader that enforces
ScriptSandbox.isClassAllowed(String) before
delegating to the real class loader. Intended to be passed as the parent
of a GroovyScriptEngine or
GroovyShell so that compiled script
code cannot load dangerous classes.-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findClass, findLibrary, findLoadedClass, findResource, findResource, findResources, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Constructor Details
-
FilteringClassLoader
- Parameters:
delegate- the real class loader to delegate to after the sandbox check passes (must not be null)
-
-
Method Details
-
loadClass
- Overrides:
loadClassin classClassLoader- Throws:
ClassNotFoundException
-