public class

ClassRelativeResourceLoader

extends DefaultResourceLoader
java.lang.Object
   ↳ org.springframework.core.io.DefaultResourceLoader
     ↳ org.springframework.core.io.ClassRelativeResourceLoader

Class Overview

ResourceLoader implementation that interprets plain resource paths as relative to a given java.lang.Class.

Summary

[Expand]
Inherited Constants
From interface org.springframework.core.io.ResourceLoader
Public Constructors
ClassRelativeResourceLoader(Class clazz)
Create a new ClassRelativeResourceLoader for the given class.
Protected Methods
Resource getResourceByPath(String path)
Return a Resource handle for the resource at the given path.
[Expand]
Inherited Methods
From class org.springframework.core.io.DefaultResourceLoader
From class java.lang.Object
From interface org.springframework.core.io.ResourceLoader

Public Constructors

public ClassRelativeResourceLoader (Class clazz)

Also: SpringCore

Create a new ClassRelativeResourceLoader for the given class.

Parameters
clazz the class to load resources through

Protected Methods

protected Resource getResourceByPath (String path)

Also: SpringCore

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.

Parameters
path the path to the resource
Returns
  • the corresponding Resource handle