Package net.sf.jkniv.sqlegance
Class DefaultClassLoader
- java.lang.Object
-
- net.sf.jkniv.sqlegance.DefaultClassLoader
-
public class DefaultClassLoader extends Object
-
-
Constructor Summary
Constructors Constructor Description DefaultClassLoader()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ClassLoadergetClassLoader()Return the default ClassLoader to use: typically the thread context ClassLoader, if available; the ClassLoader that loaded the ClassUtils class will be used as fallback.static URLgetResource(String resource)static InputStreamgetResourceAsStream(String resource)
-
-
-
Method Detail
-
getClassLoader
public static ClassLoader getClassLoader()
Return the default ClassLoader to use: typically the thread context ClassLoader, if available; the ClassLoader that loaded the ClassUtils class will be used as fallback.Call this method if you intend to use the thread context ClassLoader in a scenario where you absolutely need a non-null ClassLoader reference: for example, for class path resource loading (but not necessarily for
Class.forName, which accepts anullClassLoader reference as well).- Returns:
- the default ClassLoader (never
null) - See Also:
Thread.getContextClassLoader()
-
getResourceAsStream
public static InputStream getResourceAsStream(String resource)
-
-