public class DefaultResourceAccessor extends Object implements org.springframework.context.ResourceLoaderAware, ResourceAccessor, IOUtils
ResourceAccessor.| Modifier and Type | Field and Description |
|---|---|
protected String |
encoding |
protected org.springframework.core.io.ResourceLoader |
resourceLoader |
protected String |
resourcePath |
| Constructor and Description |
|---|
DefaultResourceAccessor()
Constructor.
|
DefaultResourceAccessor(org.springframework.core.io.ResourceLoader resourceLoader,
String encoding,
String resourcePath)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected org.springframework.core.io.Resource[] |
getResources(String normalizedPath,
org.springframework.core.io.support.PathMatchingResourcePatternResolver resolver)
Automatically finds all resources on path.
|
org.springframework.core.io.Resource[] |
getSortedResourceList(Platform platform)
Returns resource list (means list of resource objects) ordered by name for certain platform.
|
String |
getTextContentFromResource(String resourcePath)
Returns unparsed text content of specified resource.
|
List<String> |
getTokenizedSQLScriptContentFromResource(String resourcePath)
Returns tokenized SQL statements in list.
|
protected String |
normalizePath(String resourcePath,
String resourceName,
boolean directory)
Normalizes path.
|
protected String |
readResource(String resourceName,
String normalizedPath,
org.springframework.core.io.Resource resource)
Reads contents of the resource.
|
protected List<String> |
tokenizeSQLScriptContent(String content)
Tokenizes content by specified delimiter and puts it into list.
|
protected org.springframework.core.io.Resource[] |
tryToFindResourceListInDescriptor(org.springframework.core.io.support.PathMatchingResourcePatternResolver resolver,
String normalizedPath,
org.springframework.core.io.Resource[] resources)
Attempts to find and parse descriptor.txt file on classpath and retrieve list of patches from it.
|
protected org.springframework.core.io.ResourceLoader resourceLoader
protected String encoding
protected String resourcePath
public DefaultResourceAccessor()
public DefaultResourceAccessor(org.springframework.core.io.ResourceLoader resourceLoader,
String encoding,
String resourcePath)
resourceLoader - Spring ResourceLoader to use for loading resourcesencoding - encoding of the resourcesresourcePath - base path where patches should be looked up forpublic org.springframework.core.io.Resource[] getSortedResourceList(Platform platform)
getSortedResourceList in interface ResourceAccessorplatform - public List<String> getTokenizedSQLScriptContentFromResource(String resourcePath)
getTokenizedSQLScriptContentFromResource in interface ResourceAccessorresourcePath - name of patch which we want separatedpublic String getTextContentFromResource(String resourcePath)
getTextContentFromResource in interface ResourceAccessorresourcePath - name of resource from witch we want text contentprotected List<String> tokenizeSQLScriptContent(String content)
protected org.springframework.core.io.Resource[] getResources(String normalizedPath, org.springframework.core.io.support.PathMatchingResourcePatternResolver resolver)
protected String readResource(String resourceName, String normalizedPath, org.springframework.core.io.Resource resource)
protected org.springframework.core.io.Resource[] tryToFindResourceListInDescriptor(org.springframework.core.io.support.PathMatchingResourcePatternResolver resolver,
String normalizedPath,
org.springframework.core.io.Resource[] resources)
Copyright © 2020 FG Forrest, a.s.. All rights reserved.