@Component(value="core_Resources") public class ResourcesImpl extends java.lang.Object implements Resources, org.springframework.context.ResourceLoaderAware
| Constructor and Description |
|---|
ResourcesImpl(org.springframework.core.env.Environment environment) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.ClassLoader |
getClassLoader() |
org.springframework.core.io.Resource |
getResource(java.lang.String location)
Search for a resource according to the following rules:
If the location represents an URL, return a new
UrlResource for
this URL.
Try to find a file below the conf directory using location as relative path. |
java.io.InputStream |
getResourceAsStream(java.lang.String location)
Searches for a resource according to the rules explained in
Resources and returns the resource as stream
if found. |
java.lang.String |
getResourceAsString(java.lang.String location)
Searches for a resource according to the rules explained in
Resources and returns the resource as string
if found. |
void |
setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader) |
@Autowired public ResourcesImpl(org.springframework.core.env.Environment environment)
@Nullable public java.io.InputStream getResourceAsStream(java.lang.String location)
ResourcesResources and returns the resource as stream
if found. The returned stream should be closed after use.getResourceAsStream in interface Resourceslocation - resource location@Nullable public java.lang.String getResourceAsString(java.lang.String location)
ResourcesResources and returns the resource as string
if found.getResourceAsString in interface Resourceslocation - resource locationpublic org.springframework.core.io.Resource getResource(java.lang.String location)
UrlResource for
this URL.conf directory using location as relative path.
If found, return a new UrlResource for this file.ClassPathResource to retrieve content
from classpath.getResource in interface org.springframework.core.io.ResourceLoaderlocation - resource locationpublic java.lang.ClassLoader getClassLoader()
getClassLoader in interface org.springframework.core.io.ResourceLoaderpublic void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
setResourceLoader in interface org.springframework.context.ResourceLoaderAware