public abstract class AbstractLocalResourcesSelector extends java.lang.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(java.lang.String pattern)
Adds a pattern to be returned selected.
|
void |
addPatterns(java.util.List<java.lang.String> patterns)
Adds a patterns to be returned as selected.
|
void |
addPatterns(java.lang.String... patterns)
Adds a patterns to be returned as selected.
|
java.util.List<java.lang.String> |
getPatterns()
Gets the patterns.
|
java.lang.String[] |
getPropertiesNames()
Gets the properties fiels base names.
|
java.lang.String[] |
getPropertiesSuffixes()
Gets the properties files suffixes.
|
java.lang.String |
getZipArchivePattern()
Gets the current zip archive pattern.
|
protected boolean |
isZipArchive(java.lang.String name)
Matching if argument is determined to be a zip archive.
|
java.util.List<LocalResourcesSelector.Entry> |
select(java.lang.String dir)
Select a
List of LocalResourcesSelector.Entrys. |
protected java.util.List<LocalResourcesSelector.Entry> |
selectInternal(java.lang.String dir)
Select internal.
|
void |
setPropertiesNames(java.util.List<java.lang.String> propertiesNames)
Sets the properties names.
|
void |
setPropertiesNames(java.lang.String... propertiesNames)
Sets the properties names.
|
void |
setPropertiesSuffixes(java.util.List<java.lang.String> propertiesSuffixes)
Sets the properties suffixes.
|
void |
setPropertiesSuffixes(java.lang.String... propertiesSuffixes)
Sets the properties suffixes.
|
void |
setZipArchivePattern(java.lang.String zipArchivePattern)
Sets the zip archive pattern.
|
public final java.util.List<LocalResourcesSelector.Entry> select(java.lang.String dir)
LocalResourcesSelectorselect in interface LocalResourcesSelectordir - the base directorypublic void addPattern(java.lang.String pattern)
pattern - the patternpublic void addPatterns(java.lang.String... patterns)
patterns - the patternsaddPattern(String)public void addPatterns(java.util.List<java.lang.String> patterns)
patterns - the patternsaddPattern(String)public java.util.List<java.lang.String> getPatterns()
public void setZipArchivePattern(java.lang.String zipArchivePattern)
DEFAULT_PATTERN_ZIP_ARCHIVE. Setting this
pattern as NULL effectively disables
zip matching.zipArchivePattern - the new zip archive patternpublic java.lang.String getZipArchivePattern()
public void setPropertiesNames(java.lang.String... propertiesNames)
getPropertiesSuffixes().propertiesNames - the new properties namespublic void setPropertiesNames(java.util.List<java.lang.String> propertiesNames)
propertiesNames - the new properties namessetPropertiesNames(String...)public java.lang.String[] getPropertiesNames()
public void setPropertiesSuffixes(java.lang.String... propertiesSuffixes)
getPropertiesNames().propertiesSuffixes - the new properties suffixespublic void setPropertiesSuffixes(java.util.List<java.lang.String> propertiesSuffixes)
propertiesSuffixes - the new properties suffixessetPropertiesSuffixes(String...)public java.lang.String[] getPropertiesSuffixes()
protected java.util.List<LocalResourcesSelector.Entry> selectInternal(java.lang.String dir)
dir - the dirselect(String)protected boolean isZipArchive(java.lang.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