Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.ibatis.common.resources
Class Resources  view Resources download Resources.java

java.lang.Object
  extended bycom.ibatis.common.resources.Resources

public class Resources
extends java.lang.Object

A class to simplify access to resources through the classloader.


Field Summary
private static java.lang.ClassLoader defaultClassLoader
           
 
Constructor Summary
private Resources()
           
 
Method Summary
static java.lang.Class classForName(java.lang.String className)
          Loads a class
private static java.lang.ClassLoader getClassLoader()
           
static java.lang.ClassLoader getDefaultClassLoader()
          Returns the default classloader (may be null).
static java.io.File getResourceAsFile(java.lang.ClassLoader loader, java.lang.String resource)
          Returns a resource on the classpath as a File object
static java.io.File getResourceAsFile(java.lang.String resource)
          Returns a resource on the classpath as a File object
static java.util.Properties getResourceAsProperties(java.lang.ClassLoader loader, java.lang.String resource)
          Returns a resource on the classpath as a Properties object
static java.util.Properties getResourceAsProperties(java.lang.String resource)
          Returns a resource on the classpath as a Properties object
static java.io.Reader getResourceAsReader(java.lang.ClassLoader loader, java.lang.String resource)
          Returns a resource on the classpath as a Reader object
static java.io.Reader getResourceAsReader(java.lang.String resource)
          Returns a resource on the classpath as a Reader object
static java.io.InputStream getResourceAsStream(java.lang.ClassLoader loader, java.lang.String resource)
          Returns a resource on the classpath as a Stream object
static java.io.InputStream getResourceAsStream(java.lang.String resource)
          Returns a resource on the classpath as a Stream object
static java.net.URL getResourceURL(java.lang.ClassLoader loader, java.lang.String resource)
          Returns the URL of the resource on the classpath
static java.net.URL getResourceURL(java.lang.String resource)
          Returns the URL of the resource on the classpath
static java.util.Properties getUrlAsProperties(java.lang.String urlString)
          Gets a URL as a Properties object
static java.io.Reader getUrlAsReader(java.lang.String urlString)
          Gets a URL as a Reader
static java.io.InputStream getUrlAsStream(java.lang.String urlString)
          Gets a URL as an input stream
static java.lang.Object instantiate(java.lang.Class clazz)
          Creates an instance of a class
static java.lang.Object instantiate(java.lang.String className)
          Creates an instance of a class
static void setDefaultClassLoader(java.lang.ClassLoader defaultClassLoader)
          Sets the default classloader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultClassLoader

private static java.lang.ClassLoader defaultClassLoader
Constructor Detail

Resources

private Resources()
Method Detail

getDefaultClassLoader

public static java.lang.ClassLoader getDefaultClassLoader()
Returns the default classloader (may be null).


setDefaultClassLoader

public static void setDefaultClassLoader(java.lang.ClassLoader defaultClassLoader)
Sets the default classloader


getResourceURL

public static java.net.URL getResourceURL(java.lang.String resource)
                                   throws java.io.IOException
Returns the URL of the resource on the classpath


getResourceURL

public static java.net.URL getResourceURL(java.lang.ClassLoader loader,
                                          java.lang.String resource)
                                   throws java.io.IOException
Returns the URL of the resource on the classpath


getResourceAsStream

public static java.io.InputStream getResourceAsStream(java.lang.String resource)
                                               throws java.io.IOException
Returns a resource on the classpath as a Stream object


getResourceAsStream

public static java.io.InputStream getResourceAsStream(java.lang.ClassLoader loader,
                                                      java.lang.String resource)
                                               throws java.io.IOException
Returns a resource on the classpath as a Stream object


getResourceAsProperties

public static java.util.Properties getResourceAsProperties(java.lang.String resource)
                                                    throws java.io.IOException
Returns a resource on the classpath as a Properties object


getResourceAsProperties

public static java.util.Properties getResourceAsProperties(java.lang.ClassLoader loader,
                                                           java.lang.String resource)
                                                    throws java.io.IOException
Returns a resource on the classpath as a Properties object


getResourceAsReader

public static java.io.Reader getResourceAsReader(java.lang.String resource)
                                          throws java.io.IOException
Returns a resource on the classpath as a Reader object


getResourceAsReader

public static java.io.Reader getResourceAsReader(java.lang.ClassLoader loader,
                                                 java.lang.String resource)
                                          throws java.io.IOException
Returns a resource on the classpath as a Reader object


getResourceAsFile

public static java.io.File getResourceAsFile(java.lang.String resource)
                                      throws java.io.IOException
Returns a resource on the classpath as a File object


getResourceAsFile

public static java.io.File getResourceAsFile(java.lang.ClassLoader loader,
                                             java.lang.String resource)
                                      throws java.io.IOException
Returns a resource on the classpath as a File object


getUrlAsStream

public static java.io.InputStream getUrlAsStream(java.lang.String urlString)
                                          throws java.io.IOException
Gets a URL as an input stream


getUrlAsReader

public static java.io.Reader getUrlAsReader(java.lang.String urlString)
                                     throws java.io.IOException
Gets a URL as a Reader


getUrlAsProperties

public static java.util.Properties getUrlAsProperties(java.lang.String urlString)
                                               throws java.io.IOException
Gets a URL as a Properties object


classForName

public static java.lang.Class classForName(java.lang.String className)
                                    throws java.lang.ClassNotFoundException
Loads a class


instantiate

public static java.lang.Object instantiate(java.lang.String className)
                                    throws java.lang.ClassNotFoundException,
                                           java.lang.InstantiationException,
                                           java.lang.IllegalAccessException
Creates an instance of a class


instantiate

public static java.lang.Object instantiate(java.lang.Class clazz)
                                    throws java.lang.InstantiationException,
                                           java.lang.IllegalAccessException
Creates an instance of a class


getClassLoader

private static java.lang.ClassLoader getClassLoader()