Package io.jmix.core.impl
Class ResourcesImpl
java.lang.Object
io.jmix.core.impl.ResourcesImpl
- All Implemented Interfaces:
Resources,org.springframework.beans.factory.Aware,org.springframework.context.ResourceLoaderAware,org.springframework.core.io.ResourceLoader
-
Field Summary
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.core.io.ResourcegetResource(String location) Search for a resource according to the following rules: If the location represents an URL, return a newUrlResourcefor this URL. Try to find a file below theconfdirectory usinglocationas relative path.getResourceAsStream(String location) Searches for a resource according to the rules explained inResourcesand returns the resource as stream if found.getResourceAsString(String location) Searches for a resource according to the rules explained inResourcesand returns the resource as string if found.voidsetResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
-
Constructor Details
-
ResourcesImpl
@Autowired public ResourcesImpl(org.springframework.core.env.Environment environment)
-
-
Method Details
-
getResourceAsStream
Description copied from interface:ResourcesSearches for a resource according to the rules explained inResourcesand returns the resource as stream if found. The returned stream should be closed after use.- Specified by:
getResourceAsStreamin interfaceResources- Parameters:
location- resource location- Returns:
- InputStream or null if the resource is not found
-
getResourceAsString
Description copied from interface:ResourcesSearches for a resource according to the rules explained inResourcesand returns the resource as string if found.- Specified by:
getResourceAsStringin interfaceResources- Parameters:
location- resource location- Returns:
- resource content or null if the resource is not found
-
getResource
Search for a resource according to the following rules:- If the location represents an URL, return a new
UrlResourcefor this URL. - Try to find a file below the
confdirectory usinglocationas relative path. If found, return a newUrlResourcefor this file. - Otherwise return a new
ClassPathResourceto retrieve content from classpath.
- Specified by:
getResourcein interfaceorg.springframework.core.io.ResourceLoader- Parameters:
location- resource location- Returns:
- resource reference
- If the location represents an URL, return a new
-
getClassLoader
- Specified by:
getClassLoaderin interfaceorg.springframework.core.io.ResourceLoader
-
setResourceLoader
public void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader) - Specified by:
setResourceLoaderin interfaceorg.springframework.context.ResourceLoaderAware
-