public class DefaultResourceLocator extends java.lang.Object implements ResourceLocator, org.springframework.context.ResourceLoaderAware, PluginManagerAware
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.lang.String,org.springframework.core.io.Resource> |
classNameToResourceCache |
protected java.util.List<java.lang.String> |
classSearchDirectories |
static java.lang.String |
CLOSURE_MARKER |
protected org.springframework.core.io.ResourceLoader |
defaultResourceLoader |
static java.lang.String |
FILE_SEPARATOR |
protected static org.springframework.core.io.Resource |
NULL_RESOURCE |
protected org.springframework.core.io.support.PathMatchingResourcePatternResolver |
patchMatchingResolver |
protected GrailsPluginManager |
pluginManager |
protected java.util.List<java.lang.String> |
resourceSearchDirectories |
protected java.util.Map<java.lang.String,org.springframework.core.io.Resource> |
uriToResourceCache |
protected boolean |
warDeployed |
static java.lang.String |
WEB_APP_DIR |
static java.lang.String |
WILDCARD |
| Constructor and Description |
|---|
DefaultResourceLocator() |
| Modifier and Type | Method and Description |
|---|---|
org.springframework.core.io.Resource |
findResourceForClassName(java.lang.String className)
Finds the .groovy file or .java file for a given class from a Grails project.
|
org.springframework.core.io.Resource |
findResourceForURI(java.lang.String uri)
Finds a resource for the given URI
|
protected org.springframework.core.io.Resource |
findResourceInBinaryPlugins(org.codehaus.groovy.grails.core.io.DefaultResourceLocator.PluginResourceInfo info) |
protected org.springframework.core.io.ResourceLoader |
getDefaultResourceLoader() |
void |
setPluginManager(GrailsPluginManager pluginManager)
Sets the plug-in manager on this instance
|
void |
setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader) |
void |
setSearchLocation(java.lang.String searchLocation)
The basic location from which to conduct the search.
|
void |
setSearchLocations(java.util.Collection<java.lang.String> searchLocations)
Multiple locations to search.
|
public static final java.lang.String WILDCARD
public static final java.lang.String FILE_SEPARATOR
public static final java.lang.String CLOSURE_MARKER
public static final java.lang.String WEB_APP_DIR
protected static final org.springframework.core.io.Resource NULL_RESOURCE
protected org.springframework.core.io.support.PathMatchingResourcePatternResolver patchMatchingResolver
protected java.util.List<java.lang.String> classSearchDirectories
protected java.util.List<java.lang.String> resourceSearchDirectories
protected java.util.Map<java.lang.String,org.springframework.core.io.Resource> classNameToResourceCache
protected java.util.Map<java.lang.String,org.springframework.core.io.Resource> uriToResourceCache
protected org.springframework.core.io.ResourceLoader defaultResourceLoader
protected GrailsPluginManager pluginManager
protected boolean warDeployed
public void setSearchLocation(java.lang.String searchLocation)
ResourceLocatorsetSearchLocation in interface ResourceLocatorsearchLocation - The search locationprotected org.springframework.core.io.ResourceLoader getDefaultResourceLoader()
public void setSearchLocations(java.util.Collection<java.lang.String> searchLocations)
ResourceLocatorsetSearchLocations in interface ResourceLocatorsearchLocations - The locations to searchpublic org.springframework.core.io.Resource findResourceForURI(java.lang.String uri)
ResourceLocatorfindResourceForURI in interface ResourceLocatoruri - The URIprotected org.springframework.core.io.Resource findResourceInBinaryPlugins(org.codehaus.groovy.grails.core.io.DefaultResourceLocator.PluginResourceInfo info)
public org.springframework.core.io.Resource findResourceForClassName(java.lang.String className)
ResourceLocatorfindResourceForClassName in interface ResourceLocatorclassName - The class namepublic void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
setResourceLoader in interface org.springframework.context.ResourceLoaderAwarepublic void setPluginManager(GrailsPluginManager pluginManager)
PluginManagerAwaresetPluginManager in interface PluginManagerAwarepluginManager - The PluginManager