public class ClassLoaderHelper extends Object
Constructor and Description |
---|
ClassLoaderHelper() |
Modifier and Type | Method and Description |
---|---|
static Class |
forName(Class caller,
String className)
Attempt to load the named class.
|
static InputStream |
getResourceAsStream(Class caller,
String resource)
Get the specified resource as an input stream.
|
static String |
getResourceAsString(Class caller,
String resource)
Get the specified resource as a string.
|
static URL |
getResourceAsURL(Class caller,
String resource)
Get the specified resource as a URL.
|
public static Class forName(Class caller, String className) throws ClassNotFoundException
caller
- The caller's class.className
- The name of the class.ClassNotFoundException
- If the class cannot be found.public static String getResourceAsString(Class caller, String resource) throws IOException
caller
- The caller's class.resource
- The resource name.IOException
- for read errors.public static InputStream getResourceAsStream(Class caller, String resource)
caller
- The caller's class.resource
- The resource name.Copyright © 2017 JBoss by Red Hat. All rights reserved.