org.springframework.core.io

Class ClassRelativeResourceLoader

    • Constructor Detail

      • ClassRelativeResourceLoader

        public ClassRelativeResourceLoader(Class clazz)
        Create a new ClassRelativeResourceLoader for the given class.
        Parameters:
        clazz - the class to load resources through
    • Method Detail

      • getResourceByPath

        protected Resource getResourceByPath(String path)
        Description copied from class: DefaultResourceLoader
        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.

        Overrides:
        getResourceByPath in class  DefaultResourceLoader
        Parameters:
        path - the path to the resource
        Returns:
        the corresponding Resource handle
        See Also:
        ClassPathResource, org.springframework.context.support.FileSystemXmlApplicationContext#getResourceByPath, org.springframework.web.context.support.XmlWebApplicationContext#getResourceByPath