org.unitils.dbmaintainer.script.impl
Class ResourceScriptSource
java.lang.Object
org.unitils.core.util.BaseConfigurable
org.unitils.dbmaintainer.script.impl.DefaultScriptSource
org.unitils.dbmaintainer.script.impl.ResourceScriptSource
- All Implemented Interfaces:
- Configurable, ScriptSource
public class ResourceScriptSource
- extends DefaultScriptSource
Implementation of ScriptSource that reads script files from the classpath.
Wildcards in naming are allowed. When looking through the classpath it will use the PathMatchingResourcePatternResolver provided
by Spring.
When finding multiple files that have the same name the system will take te most recent one. Script files should be located in the
package configured by DefaultScriptSource.PROPKEY_SCRIPT_LOCATIONS. Valid script files start with a version number followed by an underscore, and
end with the extension configured by DefaultScriptSource.PROPKEY_SCRIPT_EXTENSIONS.
- Since:
- 1.0.2
- Author:
- Thomas De Rycke, Jef Verelst
| Methods inherited from class org.unitils.dbmaintainer.script.impl.DefaultScriptSource |
assertNoDuplicateIndexes, convertToScriptNameScriptMap, createScript, getAllUpdateScripts, getIncrementalScripts, getNewScripts, getPostProcessingScripts, getScriptExtensions, isExistingIndexedScriptModified, isPostProcessingScript, isScriptFile, loadAndOrganizeAllScripts, useScriptFileLastModificationDates |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ResourceScriptSource
public ResourceScriptSource()
loadAllScripts
protected List<Script> loadAllScripts(String dialect)
- Overrides:
loadAllScripts in class DefaultScriptSource
- Returns:
- A List containing all scripts in the given script locations, not null
- See Also:
org.unitils.dbmaintainer.script.impl.DefaultScriptSource#loadAllScripts()
getScriptsAt
protected void getScriptsAt(List<Script> scripts,
String scriptRoot,
String relativeLocation)
- Description copied from class:
DefaultScriptSource
- Adds all scripts available in the given directory or one of its subdirectories to the
given List of files
- Overrides:
getScriptsAt in class DefaultScriptSource
- See Also:
DefaultScriptSource.getScriptsAt(java.util.List, java.lang.String, java.lang.String)
getResourcePickingStrategie
protected ResourcePickingStrategie getResourcePickingStrategie()
- use unitil propertie instead of hardcoding
- Returns:
Copyright © 2014. All Rights Reserved.