Cisco Systems, Inc.

com.pcube.apps.engage
Class GeneralCaseClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by com.pcube.apps.engage.GeneralCaseClassLoader

public class GeneralCaseClassLoader
extends ClassLoader

copy paste from the internet with minor changes.

Author:
ronyb

Constructor Summary
GeneralCaseClassLoader(ClassLoader existingClassLoader)
          Constructs a TestCaseLoader.
GeneralCaseClassLoader(ClassLoader parent, String classPath)
          Constructs a TestCaseLoader.
GeneralCaseClassLoader(String classPath)
          Constructs a TestCaseLoader.
GeneralCaseClassLoader(String classPath, ClassLoader existingClassLoader)
          Constructs a TestCaseLoader.
 
Method Summary
 URL getResource(String name)
          will try to locate resoyrce with the current class loader and if not found will scan the local classpath.
 InputStream getResourceAsStream(String name)
           
 boolean isExcluded(String name)
           
 Class loadClass(String name, boolean resolve)
           
 void setBaseDirectory(String theBaseDirectory)
           
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, getParent, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeneralCaseClassLoader

public GeneralCaseClassLoader(ClassLoader existingClassLoader)
Constructs a TestCaseLoader. It scans the class path and the excluded package paths


GeneralCaseClassLoader

public GeneralCaseClassLoader(String classPath)
Constructs a TestCaseLoader. It scans the class path and the excluded package paths


GeneralCaseClassLoader

public GeneralCaseClassLoader(ClassLoader parent,
                              String classPath)
Constructs a TestCaseLoader. It scans the class path and the excluded package paths


GeneralCaseClassLoader

public GeneralCaseClassLoader(String classPath,
                              ClassLoader existingClassLoader)
Constructs a TestCaseLoader. It scans the class path and the excluded package paths

Method Detail

getResource

public URL getResource(String name)
will try to locate resoyrce with the current class loader and if not found will scan the local classpath.

Overrides:
getResource in class ClassLoader
Returns:
URL (may be null if resource was not found).

getResourceAsStream

public InputStream getResourceAsStream(String name)
Overrides:
getResourceAsStream in class ClassLoader
Returns:
InputStream (may be null if resource was not lcoated)

isExcluded

public boolean isExcluded(String name)

loadClass

public Class loadClass(String name,
                       boolean resolve)
                throws ClassNotFoundException
Overrides:
loadClass in class ClassLoader
Throws:
ClassNotFoundException

setBaseDirectory

public void setBaseDirectory(String theBaseDirectory)
Parameters:
theBaseDirectory -

Cisco Systems, Inc.

Copyright © 2011 Cisco Systems, Inc. Confidential.