Package de.soldin.jumpcore
Class FlexibleClassLoader
- java.lang.Object
-
- java.lang.ClassLoader
-
- java.security.SecureClassLoader
-
- java.net.URLClassLoader
-
- de.soldin.jumpcore.FlexibleClassLoader
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class FlexibleClassLoader extends URLClassLoader
pretty much an url classloader that wraps a parent (by default) and let's you add urls in front (prepend) or at the end (append via finalCl) during runtime
-
-
Constructor Summary
Constructors Constructor Description FlexibleClassLoader()
FlexibleClassLoader(ClassLoader parent, boolean set_parent)
FlexibleClassLoader(URL[] urls)
FlexibleClassLoader(URL[] urls, ClassLoader parent, boolean set_parent)
-
Method Summary
-
Methods inherited from class java.net.URLClassLoader
addURL, close, definePackage, findClass, getPermissions, getResourceAsStream, newInstance, newInstance
-
Methods inherited from class java.security.SecureClassLoader
defineClass, defineClass
-
Methods inherited from class java.lang.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, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
-
-
-
Constructor Detail
-
FlexibleClassLoader
public FlexibleClassLoader()
-
FlexibleClassLoader
public FlexibleClassLoader(URL[] urls)
-
FlexibleClassLoader
public FlexibleClassLoader(ClassLoader parent, boolean set_parent)
-
FlexibleClassLoader
public FlexibleClassLoader(URL[] urls, ClassLoader parent, boolean set_parent)
-
-
Method Detail
-
prepend
public void prepend(String path)
-
prependURL
public void prependURL(URL url)
-
prependURLs
public void prependURLs(URL[] urls)
-
prependAllFiles
public boolean prependAllFiles(String path)
-
prependAllFilesRecursive
public boolean prependAllFilesRecursive(String path)
-
append
public void append(String path)
-
appendURL
public void appendURL(URL url)
-
appendURLs
public void appendURLs(URL[] urls)
-
appendAllFiles
public boolean appendAllFiles(String path)
-
appendAllFilesRecursive
public boolean appendAllFilesRecursive(String path)
-
addAllFiles
public boolean addAllFiles(String path, String suffix, boolean recursive, boolean prepend)
-
addCL
public boolean addCL(ClassLoader cl)
-
remCL
public boolean remCL(ClassLoader cl)
-
isBlacklisted
public boolean isBlacklisted(String name)
-
blacklist
public boolean blacklist(String regexp)
-
whitelist
public boolean whitelist(String regexp)
-
loadClass
public Class<?> loadClass(String name) throws ClassNotFoundException
- Overrides:
loadClass
in classClassLoader
- Throws:
ClassNotFoundException
-
findResource
public URL findResource(String name)
- Overrides:
findResource
in classURLClassLoader
-
findResources
public Enumeration<URL> findResources(String name) throws IOException
- Overrides:
findResources
in classURLClassLoader
- Throws:
IOException
-
getURLs
public URL[] getURLs()
- Overrides:
getURLs
in classURLClassLoader
-
isURLCL
public static boolean isURLCL(ClassLoader cl)
-
getCaller
public String getCaller()
-
getBase
public static String getBase()
-
getBaseFolder
public static String getBaseFolder()
-
-