com.ibatis.common.resources
public class Resources extends Object
| Method Summary | |
|---|---|
| static Class | classForName(String className)
Loads a class
|
| static Charset | getCharset() |
| static ClassLoader | getDefaultClassLoader()
Returns the default classloader (may be null).
|
| static File | getResourceAsFile(String resource)
Returns a resource on the classpath as a File object
|
| static File | getResourceAsFile(ClassLoader loader, String resource)
Returns a resource on the classpath as a File object
|
| static Properties | getResourceAsProperties(String resource)
Returns a resource on the classpath as a Properties object
|
| static Properties | getResourceAsProperties(ClassLoader loader, String resource)
Returns a resource on the classpath as a Properties object
|
| static Reader | getResourceAsReader(String resource)
Returns a resource on the classpath as a Reader object
|
| static Reader | getResourceAsReader(ClassLoader loader, String resource)
Returns a resource on the classpath as a Reader object
|
| static InputStream | getResourceAsStream(String resource)
Returns a resource on the classpath as a Stream object
|
| static InputStream | getResourceAsStream(ClassLoader loader, String resource)
Returns a resource on the classpath as a Stream object
|
| static URL | getResourceURL(String resource)
Returns the URL of the resource on the classpath
|
| static URL | getResourceURL(ClassLoader loader, String resource)
Returns the URL of the resource on the classpath
|
| static Properties | getUrlAsProperties(String urlString)
Gets a URL as a Properties object
|
| static Reader | getUrlAsReader(String urlString)
Gets a URL as a Reader
|
| static InputStream | getUrlAsStream(String urlString)
Gets a URL as an input stream
|
| static Object | instantiate(String className)
Creates an instance of a class
|
| static Object | instantiate(Class clazz)
Creates an instance of a class
|
| static void | setCharset(Charset charset)
Use this method to set the Charset to be used when
calling the getResourceAsReader methods. |
| static void | setDefaultClassLoader(ClassLoader defaultClassLoader)
Sets the default classloader
|
Parameters: className - the class to load
Returns: The loaded class
Throws: ClassNotFoundException If the class cannot be found (duh!)
Returns: The default classloader
Parameters: resource The resource to find
Returns: The resource
Throws: IOException If the resource cannot be found or read
Parameters: loader - the classloader used to load the resource resource - the resource to find
Returns: The resource
Throws: IOException If the resource cannot be found or read
Parameters: resource The resource to find
Returns: The resource
Throws: IOException If the resource cannot be found or read
Parameters: loader The classloader used to load the resource resource The resource to find
Returns: The resource
Throws: IOException If the resource cannot be found or read
Parameters: resource The resource to find
Returns: The resource
Throws: IOException If the resource cannot be found or read
Parameters: loader The classloader used to load the resource resource The resource to find
Returns: The resource
Throws: IOException If the resource cannot be found or read
Parameters: resource The resource to find
Returns: The resource
Throws: IOException If the resource cannot be found or read
Parameters: loader The classloader used to load the resource resource The resource to find
Returns: The resource
Throws: IOException If the resource cannot be found or read
Parameters: resource The resource to find
Returns: The resource
Throws: IOException If the resource cannot be found or read
Parameters: loader The classloader used to load the resource resource The resource to find
Returns: The resource
Throws: IOException If the resource cannot be found or read
Parameters: urlString - the URL to get
Returns: A Properties object with the data from the URL
Throws: IOException If the resource cannot be found or read
Parameters: urlString - the URL to get
Returns: A Reader with the data from the URL
Throws: IOException If the resource cannot be found or read
Parameters: urlString - the URL to get
Returns: An input stream with the data from the URL
Throws: IOException If the resource cannot be found or read
Parameters: className - the class to create
Returns: An instance of the class
Throws: ClassNotFoundException If the class cannot be found (duh!) InstantiationException If the class cannot be instantiaed IllegalAccessException If the class is not public, or other access problems arise
Parameters: clazz - the class to create
Returns: An instance of the class
Throws: InstantiationException If the class cannot be instantiaed IllegalAccessException If the class is not public, or other access problems arise
Parameters: charset
Parameters: defaultClassLoader - the new default ClassLoader