net.sf.jmp3renamer
Class JarClassLoader
java.lang.Object
java.lang.ClassLoader
net.sf.jmp3renamer.JarClassLoader
public class JarClassLoader
- extends ClassLoader
This ClassLoader is designed for plugin-based applications. The main design
goal is the possibility to close the jarfile, so that it can be deleted or
replaced by newer ones.
Methods inherited from class java.lang.ClassLoader |
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
jar
private JarFile jar
cache
private Hashtable cache
JarClassLoader
public JarClassLoader(String jar)
throws IOException
- Throws:
IOException
JarClassLoader
public JarClassLoader(File jar)
throws IOException
- Throws:
IOException
closeJarFile
public void closeJarFile()
throws IOException
- Throws:
IOException
findClass
protected Class findClass(String clazz)
throws ClassNotFoundException
- Overrides:
findClass
in class ClassLoader
- Throws:
ClassNotFoundException
loadClassFromJar
private Class loadClassFromJar(String clazz)
getResourceAsStream
public InputStream getResourceAsStream(String resource)
- Overrides:
getResourceAsStream
in class ClassLoader
classToFile
private String classToFile(String name)