public abstract class AbstractLocalResourcesSelector extends Object implements LocalResourcesSelector
LocalResourcesSelector supporting simple
use cases where user needs to localise properties, zip and jar files.LocalResourcesSelector.Entry| Constructor and Description |
|---|
AbstractLocalResourcesSelector() |
| Modifier and Type | Method and Description |
|---|---|
void |
addPattern(String pattern)
Adds a pattern to be returned selected.
|
void |
addPatterns(List<String> patterns)
Adds a patterns to be returned as selected.
|
void |
addPatterns(String... patterns)
Adds a patterns to be returned as selected.
|
List<String> |
getPatterns()
Gets the patterns.
|
String[] |
getPropertiesNames()
Gets the properties fiels base names.
|
String[] |
getPropertiesSuffixes()
Gets the properties files suffixes.
|
String |
getZipArchivePattern()
Gets the current zip archive pattern.
|
protected boolean |
isZipArchive(String name)
Matching if argument is determined to be a zip archive.
|
List<LocalResourcesSelector.Entry> |
select(String dir)
Select a
List of LocalResourcesSelector.Entrys. |
protected List<LocalResourcesSelector.Entry> |
selectInternal(String dir)
Select internal.
|
void |
setPropertiesNames(List<String> propertiesNames)
Sets the properties names.
|
void |
setPropertiesNames(String... propertiesNames)
Sets the properties names.
|
void |
setPropertiesSuffixes(List<String> propertiesSuffixes)
Sets the properties suffixes.
|
void |
setPropertiesSuffixes(String... propertiesSuffixes)
Sets the properties suffixes.
|
void |
setZipArchivePattern(String zipArchivePattern)
Sets the zip archive pattern.
|
public final List<LocalResourcesSelector.Entry> select(String dir)
LocalResourcesSelectorselect in interface LocalResourcesSelectordir - the base directorypublic void addPattern(String pattern)
pattern - the patternpublic void addPatterns(String... patterns)
patterns - the patternsaddPattern(String)public void addPatterns(List<String> patterns)
patterns - the patternsaddPattern(String)public void setZipArchivePattern(String zipArchivePattern)
DEFAULT_PATTERN_ZIP_ARCHIVE. Setting this
pattern as NULL effectively disables
zip matching.zipArchivePattern - the new zip archive patternpublic String getZipArchivePattern()
public void setPropertiesNames(String... propertiesNames)
getPropertiesSuffixes().propertiesNames - the new properties namespublic void setPropertiesNames(List<String> propertiesNames)
propertiesNames - the new properties namessetPropertiesNames(String...)public String[] getPropertiesNames()
public void setPropertiesSuffixes(String... propertiesSuffixes)
getPropertiesNames().propertiesSuffixes - the new properties suffixespublic void setPropertiesSuffixes(List<String> propertiesSuffixes)
propertiesSuffixes - the new properties suffixessetPropertiesSuffixes(String...)public String[] getPropertiesSuffixes()
protected List<LocalResourcesSelector.Entry> selectInternal(String dir)
dir - the dirselect(String)protected boolean isZipArchive(String name)
PatternMatchUtils.simpleMatch(String, String)
for actual matching. Match pattern is defined in variable
zipArchivePattern and can be altered using method
setZipArchivePattern(String).name - the name to match