ks.jarloader
Class JarLoader

java.lang.Object
  |
  +--java.lang.ClassLoader
        |
        +--ks.jarloader.JarLoader

public class JarLoader
extends java.lang.ClassLoader

Block component to aid in the loading of Jar files.


Field Summary
protected  JarInfo info
           
protected  java.lang.String jarName
           
protected  java.util.Hashtable urlCache
          Cached URLs to resources.
 
Constructor Summary
JarLoader(java.lang.String path, java.lang.String jarName)
          Construct a new JarLoader that will load classes from the jar File named jarName found at the path named in path.
 
Method Summary
protected  java.lang.Class findClass(java.lang.String name)
           
protected  java.net.URL findResource(java.lang.String name)
          Finds the resource with the given name.
 java.lang.String getJarName()
           
 java.util.jar.Manifest getManifest()
           
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, 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
 

Field Detail

info

protected JarInfo info

jarName

protected java.lang.String jarName

urlCache

protected java.util.Hashtable urlCache
Cached URLs to resources.

Constructor Detail

JarLoader

public JarLoader(java.lang.String path,
                 java.lang.String jarName)
          throws java.io.FileNotFoundException
Construct a new JarLoader that will load classes from the jar File named jarName found at the path named in path.

Parameters:
jarName - the name of the jar file to be loaded e.g. "classes.jar"
path - the path to the jar file. e.g. "jar/storage/"
Method Detail

findClass

protected java.lang.Class findClass(java.lang.String name)
                             throws java.lang.ClassNotFoundException
Overrides:
findClass in class java.lang.ClassLoader
java.lang.ClassNotFoundException

findResource

protected java.net.URL findResource(java.lang.String name)
Finds the resource with the given name. Class loader implementations should override this method to specify where to find resources.

Overrides:
findResource in class java.lang.ClassLoader
Parameters:
name - The resource name
Returns:
A URL object for reading the resource, or null if the resource could not be found
Since:
1.2

getJarName

public java.lang.String getJarName()

getManifest

public java.util.jar.Manifest getManifest()