public class DelegatingResourceLoader extends Object implements org.springframework.core.io.ResourceLoader, org.springframework.context.ResourceLoaderAware
ResourceLoader implementation that delegates to other ResourceLoader instances
that are stored in a Map with their associated URI schemes as the keys. If a scheme does not
exist within the Map, it will fallback to a DefaultResourceLoader.
The Map may be empty (or null).
This implementation is also caching remote resources which are not directly accessible
as File into either a given cache directory or on default a temporary location
prefixed by "deployer-resource-cache".
| Constructor and Description |
|---|
DelegatingResourceLoader()
Instantiates a new delegating resource loader.
|
DelegatingResourceLoader(Map<String,org.springframework.core.io.ResourceLoader> loaders)
Instantiates a new delegating resource loader.
|
DelegatingResourceLoader(Map<String,org.springframework.core.io.ResourceLoader> loaders,
File cacheDirectory)
Instantiates a new delegating resource loader.
|
| Modifier and Type | Method and Description |
|---|---|
ClassLoader |
getClassLoader() |
org.springframework.core.io.Resource |
getResource(String location) |
void |
setResourceLoader(org.springframework.core.io.ResourceLoader contextResourceLoader) |
public DelegatingResourceLoader()
public DelegatingResourceLoader(Map<String,org.springframework.core.io.ResourceLoader> loaders)
loaders - the loaderspublic void setResourceLoader(org.springframework.core.io.ResourceLoader contextResourceLoader)
setResourceLoader in interface org.springframework.context.ResourceLoaderAwarepublic org.springframework.core.io.Resource getResource(String location)
getResource in interface org.springframework.core.io.ResourceLoaderpublic ClassLoader getClassLoader()
getClassLoader in interface org.springframework.core.io.ResourceLoaderCopyright © 2017 Pivotal Software, Inc.. All rights reserved.