org.xnap.loader
Class XNapClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by java.security.SecureClassLoader
          extended by java.net.URLClassLoader
              extended by org.xnap.loader.XNapClassLoader

public class XNapClassLoader
extends java.net.URLClassLoader

This class provides support to add additional jar files to the classpath.


Method Summary
 void add(java.lang.String[] files)
          Locates files in jar search path and adds them to the classpath.
 void add(java.net.URL url)
          Adds url to the classpath.
static boolean areDependenciesSatisfied(java.lang.String[] depends)
          Returns true, if all depends are located in the jar search path.
static java.lang.String getHomeDir()
          Returns the XNap preferences directory with a trailing file separator.
static XNapClassLoader getInstance()
           
static java.io.File[] getSearchPath()
          Returns the jar search path.
static java.lang.String getURLsAsString()
           
static boolean isLoaded(java.net.URL url)
          Returns true if url has been already loaded
static java.io.File locate(java.lang.String filename)
          Searches the jar search path for filename and returns a File object.
 
Methods inherited from class java.net.URLClassLoader
addURL, definePackage, findClass, findResource, findResources, getPermissions, getURLs, newInstance, newInstance
 
Methods inherited from class java.security.SecureClassLoader
defineClass, defineClass
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, 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
 

Method Detail

getInstance

public static XNapClassLoader getInstance()

add

public void add(java.net.URL url)
         throws java.io.IOException
Adds url to the classpath.

Throws:
java.io.IOException

add

public void add(java.lang.String[] files)
         throws java.io.IOException
Locates files in jar search path and adds them to the classpath.

Throws:
java.io.IOException - if a file can not be found or is not a valid jar file
See Also:
locate(String)

areDependenciesSatisfied

public static boolean areDependenciesSatisfied(java.lang.String[] depends)
Returns true, if all depends are located in the jar search path.


getHomeDir

public static java.lang.String getHomeDir()
Returns the XNap preferences directory with a trailing file separator.


getURLsAsString

public static java.lang.String getURLsAsString()

getSearchPath

public static java.io.File[] getSearchPath()
Returns the jar search path.


locate

public static java.io.File locate(java.lang.String filename)
Searches the jar search path for filename and returns a File object.

Returns:
null, if filename was not found; the file, otherwise
See Also:
locate(String)

isLoaded

public static boolean isLoaded(java.net.URL url)
Returns true if url has been already loaded



Copyright © 2001-2005 XNap Team. All Rights Reserved.