Save This Page
Home » spring-framework-2.5.5-with-dependencies » org.springframework » core » io » [javadoc | source]
org.springframework.core.io
public class: DefaultResourceLoader [javadoc | source]
java.lang.Object
   org.springframework.core.io.DefaultResourceLoader

All Implemented Interfaces:
    ResourceLoader

Direct Known Subclasses:
    XmlWebApplicationContext, StaticApplicationContext, ClassPathXmlApplicationContext, FileSystemResourceLoader, GenericApplicationContext, AbstractXmlApplicationContext, GenericWebApplicationContext, ResourceAdapterApplicationContext, AbstractRefreshableWebApplicationContext, FileSystemXmlApplicationContext, AbstractRefreshableConfigApplicationContext, StaticPortletApplicationContext, StaticWebApplicationContext, AbstractApplicationContext, PortletContextResourceLoader, AbstractRefreshableApplicationContext, AbstractRefreshablePortletApplicationContext, ServletContextResourceLoader, XmlPortletApplicationContext

Default implementation of the ResourceLoader interface. Used by ResourceEditor , and serves as base class for org.springframework.context.support.AbstractApplicationContext . Can also be used standalone.

Will return a UrlResource if the location value is a URL, and a ClassPathResource if it is a non-URL path or a "classpath:" pseudo-URL.

Constructor:
 public DefaultResourceLoader() 
 public DefaultResourceLoader(ClassLoader classLoader) 
    Create a new DefaultResourceLoader.
    Parameters:
    classLoader - the ClassLoader to load class path resources with, or null for using the thread context class loader at the time of actual resource access
Method from org.springframework.core.io.DefaultResourceLoader Summary:
getClassLoader,   getResource,   getResourceByPath,   setClassLoader
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.springframework.core.io.DefaultResourceLoader Detail:
 public ClassLoader getClassLoader() 
    Return the ClassLoader to load class path resources with, or null if using the thread context class loader on actual access (applying to the thread that constructs the ClassPathResource object).

    Will get passed to ClassPathResource's constructor for all ClassPathResource objects created by this resource loader.

 public Resource getResource(String location) 
 protected Resource getResourceByPath(String path) 
    Return a Resource handle for the resource at the given path.

    The default implementation supports class path locations. This should be appropriate for standalone implementations but can be overridden, e.g. for implementations targeted at a Servlet container.

 public  void setClassLoader(ClassLoader classLoader) 
    Specify the ClassLoader to load class path resources with, or null for using the thread context class loader at the time of actual resource access.

    The default is that ClassLoader access will happen using the thread context class loader at the time of this ResourceLoader's initialization.