public class ResourceLocator extends Object
Modifier and Type | Field and Description |
---|---|
protected Map<String,Resource> |
classNameToResourceCache |
protected List<String> |
classSearchDirectories |
static String |
CLOSURE_MARKER |
protected ResourceLoader |
defaultResourceLoader |
static String |
FILE_SEPARATOR |
protected static Resource |
NULL_RESOURCE |
protected PathMatchingResourcePatternResolver |
patchMatchingResolver |
protected List<String> |
resourceSearchDirectories |
protected Map<String,Resource> |
uriToResourceCache |
static String |
WEB_APP_DIR |
static String |
WILDCARD |
Constructor and Description |
---|
ResourceLocator() |
Modifier and Type | Method and Description |
---|---|
Resource |
findResourceForClassName(String className)
Find a resource for class name.
|
Resource |
findResourceForURI(String uri)
Find a resource for URI.
|
protected ResourceLoader |
getDefaultResourceLoader() |
void |
setResourceLoader(ResourceLoader resourceLoader)
Sets the default resource loader.
|
void |
setSearchLocation(String searchLocation)
Set the search location.
|
void |
setSearchLocations(Collection<String> searchLocations)
Set search locations.
|
public static final String WILDCARD
public static final String FILE_SEPARATOR
public static final String CLOSURE_MARKER
public static final String WEB_APP_DIR
protected static final Resource NULL_RESOURCE
protected PathMatchingResourcePatternResolver patchMatchingResolver
protected ResourceLoader defaultResourceLoader
public void setSearchLocation(String searchLocation)
searchLocation
- The search locationprotected ResourceLoader getDefaultResourceLoader()
public void setSearchLocations(Collection<String> searchLocations)
searchLocations
- The search locationspublic Resource findResourceForURI(String uri)
uri
- The urinull
otherwisepublic Resource findResourceForClassName(String className)
className
- The class namenull
otherwisepublic void setResourceLoader(ResourceLoader resourceLoader)
resourceLoader
- The resource loader