All Packages Class Hierarchy This Package Previous Next Index
Class pnuts.ext.JarClassLoader
pnuts.ext.JarClassLoader
- public class JarClassLoader
This classloader can read JAR files dynamically.
jarClassLoader.pnut is a sample script in Pnuts.
Besides, after this class is loaded, jar URL can be used as defined in JDK1.2.
For example, URL("jar:http://www.etale.com/pnuts/pnuts.jar!/lib/init.pnut").
-
classes
-
-
resources
-
-
JarClassLoader()
-
-
getLoader(Object)
-
-
getResource(String)
- URL scheme for a resource in a JAR file is:
-
getResourceAsStream(String)
- Get an InputStream on a given resource.
-
loadClass(String, boolean)
- Resolves the specified name to a Class.
-
loadJar(String)
- Load a JAR file specified with the filename.
-
loadJar(URL)
- Load a JAR file from the specified URL.
-
loadJar(ZipFile)
-
-
loadJar(ZipInputStream)
- Load a JAR file through ZipInputStream.
classes
public Hashtable classes
resources
public Hashtable resources
JarClassLoader
public JarClassLoader()
getLoader
public static JarClassLoader getLoader(Object key)
loadJar
public void loadJar(URL url) throws IOException
- Load a JAR file from the specified URL.
loadJar
public void loadJar(ZipInputStream zin) throws IOException
- Load a JAR file through ZipInputStream. The contents of entries
are kept in a hashtable (, so this operation is heavy weight).
When JAR file is randomly accessible, use loadJar(String filename).
loadJar
public void loadJar(String filename) throws IOException
- Load a JAR file specified with the filename. The corresponding
ZipFile object is kept in a hashtable.
loadJar
protected void loadJar(ZipFile file) throws IOException
loadClass
public Class loadClass(String name,
boolean resolve) throws ClassNotFoundException
- Resolves the specified name to a Class. The method loadClass() is
called by the virtual machine.
If the resolve
flag is true, the method should call
the resolveClass
method on the resulting class object.
- Parameters:
- name - the name of the desired Class.
- resolve - true if the Class needs to be resolved.
- Returns:
- the resulting Class, or null if it was not found.
- Throws: ClassNotFoundException
- if the class loader cannot find
a definition for the class.
getResource
public URL getResource(String name)
- URL scheme for a resource in a JAR file is:
getResourceAsStream
public InputStream getResourceAsStream(String name)
- Get an InputStream on a given resource. Will return null if no
resource with this name is found.
- Parameters:
- name - the name of the resource, to be used as is.
- Returns:
- an InputStream on the resource, or null if not found.
All Packages Class Hierarchy This Package Previous Next Index