|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ibatis.io.Resources
public class Resources
A class to simplify access to resources through the classloader.
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(ClassLoader loader,
String resource)
Returns a resource on the classpath as a File object |
static File |
getResourceAsFile(String resource)
Returns a resource on the classpath as a File object |
static Properties |
getResourceAsProperties(ClassLoader loader,
String resource)
Returns a resource on the classpath as a Properties object |
static Properties |
getResourceAsProperties(String resource)
Returns a resource on the classpath as a Properties object |
static Reader |
getResourceAsReader(ClassLoader loader,
String resource)
Returns a resource on the classpath as a Reader object |
static Reader |
getResourceAsReader(String resource)
Returns a resource on the classpath as a Reader object |
static InputStream |
getResourceAsStream(ClassLoader loader,
String resource)
Returns a resource on the classpath as a Stream object |
static InputStream |
getResourceAsStream(String resource)
Returns a resource on the classpath as a Stream object |
static URL |
getResourceURL(ClassLoader loader,
String resource)
Returns the URL of the resource on the classpath |
static URL |
getResourceURL(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 void |
setCharset(Charset charset)
|
static void |
setDefaultClassLoader(ClassLoader defaultClassLoader)
Sets the default classloader |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ClassLoader getDefaultClassLoader()
public static void setDefaultClassLoader(ClassLoader defaultClassLoader)
defaultClassLoader
- - the new default ClassLoaderpublic static URL getResourceURL(String resource) throws IOException
resource
- The resource to find
IOException
- If the resource cannot be found or readpublic static URL getResourceURL(ClassLoader loader, String resource) throws IOException
loader
- The classloader used to fetch the resourceresource
- The resource to find
IOException
- If the resource cannot be found or readpublic static InputStream getResourceAsStream(String resource) throws IOException
resource
- The resource to find
IOException
- If the resource cannot be found or readpublic static InputStream getResourceAsStream(ClassLoader loader, String resource) throws IOException
loader
- The classloader used to fetch the resourceresource
- The resource to find
IOException
- If the resource cannot be found or readpublic static Properties getResourceAsProperties(String resource) throws IOException
resource
- The resource to find
IOException
- If the resource cannot be found or readpublic static Properties getResourceAsProperties(ClassLoader loader, String resource) throws IOException
loader
- The classloader used to fetch the resourceresource
- The resource to find
IOException
- If the resource cannot be found or readpublic static Reader getResourceAsReader(String resource) throws IOException
resource
- The resource to find
IOException
- If the resource cannot be found or readpublic static Reader getResourceAsReader(ClassLoader loader, String resource) throws IOException
loader
- The classloader used to fetch the resourceresource
- The resource to find
IOException
- If the resource cannot be found or readpublic static File getResourceAsFile(String resource) throws IOException
resource
- The resource to find
IOException
- If the resource cannot be found or readpublic static File getResourceAsFile(ClassLoader loader, String resource) throws IOException
loader
- - the classloader used to fetch the resourceresource
- - the resource to find
IOException
- If the resource cannot be found or readpublic static InputStream getUrlAsStream(String urlString) throws IOException
urlString
- - the URL to get
IOException
- If the resource cannot be found or readpublic static Reader getUrlAsReader(String urlString) throws IOException
urlString
- - the URL to get
IOException
- If the resource cannot be found or readpublic static Properties getUrlAsProperties(String urlString) throws IOException
urlString
- - the URL to get
IOException
- If the resource cannot be found or readpublic static Class classForName(String className) throws ClassNotFoundException
className
- - the class to fetch
ClassNotFoundException
- If the class cannot be found (duh!)public static Charset getCharset()
public static void setCharset(Charset charset)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |