public abstract class PathScanningMatcher extends Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
caseSensitive
Whether or not the file system should be treated as a case sensitive one.
|
protected List<String> |
includePatterns
The patterns for the files to be included.
|
protected String |
separator
The file separator to use to parse paths - default=local O/S separator
|
Modifier | Constructor and Description |
---|---|
protected |
PathScanningMatcher() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
couldHoldIncluded(String name)
Tests whether or not a name matches the start of at least one include pattern.
|
List<String> |
getIncludes() |
String |
getSeparator() |
boolean |
isCaseSensitive() |
protected boolean |
isIncluded(String name)
Tests whether or not a name matches against at least one include pattern.
|
static String |
normalizePattern(String pattern)
Normalizes the pattern, e.g.
|
void |
setCaseSensitive(boolean caseSensitive) |
void |
setIncludes(Collection<String> includes) |
void |
setIncludes(String... includes)
Sets the list of include patterns to use.
|
void |
setSeparator(String separator) |
protected boolean caseSensitive
protected String separator
public void setIncludes(String... includes)
Sets the list of include patterns to use. All '/' and '\' characters are replaced by
File.separatorChar
, so the separator used need not match File.separatorChar
.
When a pattern ends with a '/' or '\', "**" is appended.
includes
- A list of include patterns. May be null
, indicating that all files should be included. If
a non-null
list is given, all elements must be non-null
.public void setIncludes(Collection<String> includes)
public boolean isCaseSensitive()
public void setCaseSensitive(boolean caseSensitive)
public String getSeparator()
public void setSeparator(String separator)
protected boolean isIncluded(String name)
name
- The name to match. Must not be null
.true
when the name matches against at least one include pattern, or false
otherwise.protected boolean couldHoldIncluded(String name)
name
- The name to match. Must not be null
.true
when the name matches against the start of at least one include pattern, or
false
otherwise.Copyright © 2008–2024 The Apache Software Foundation. All rights reserved.