org.jclouds.util
Class ClassLoadingUtils

java.lang.Object
  extended by org.jclouds.util.ClassLoadingUtils

public class ClassLoadingUtils
extends Object


Constructor Summary
ClassLoadingUtils()
           
 
Method Summary
static Class<?> loadClass(Class<?> contextClass, String className)
          Loads a class using the class loader.
static URL loadResource(Class<?> contextClass, String resourceName)
          Returns the url of a resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassLoadingUtils

public ClassLoadingUtils()
Method Detail

loadClass

public static Class<?> loadClass(Class<?> contextClass,
                                 String className)
Loads a class using the class loader. 1. The class loader of the context class is being used. 2. The thread context class loader is being used. If both approaches fail, returns null.

Parameters:
contextClass - The name of a context class to use.
className - The name of the class to load
Returns:
The class or null if no class loader could load the class.

loadResource

public static URL loadResource(Class<?> contextClass,
                               String resourceName)
Returns the url of a resource. 1. The context class is being used. 2. The thread context class loader is being used. If both approach fail, returns null.

Parameters:
contextClass -
resourceName -
Returns:


Copyright © 2009-2012 jclouds. All Rights Reserved.