Package org.apache.sshd.common.util.io
Class PathScanningMatcher
- java.lang.Object
-
- org.apache.sshd.common.util.io.PathScanningMatcher
-
- Direct Known Subclasses:
DirectoryScanner
public abstract class PathScanningMatcher extends Object
- Author:
- Apache MINA SSHD Project
-
-
Field Summary
Fields Modifier and Type Field Description protected booleancaseSensitiveWhether or not the file system should be treated as a case sensitive one.protected List<String>includePatternsThe patterns for the files to be included.protected StringseparatorThe file separator to use to parse paths - default=local O/S separator
-
Constructor Summary
Constructors Modifier Constructor Description protectedPathScanningMatcher()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancouldHoldIncluded(String name)Tests whether or not a name matches the start of at least one include pattern.List<String>getIncludes()StringgetSeparator()booleanisCaseSensitive()protected booleanisIncluded(String name)Tests whether or not a name matches against at least one include pattern.static StringnormalizePattern(String pattern)Normalizes the pattern, e.g.voidsetCaseSensitive(boolean caseSensitive)voidsetIncludes(String... includes)Sets the list of include patterns to use.voidsetIncludes(Collection<String> includes)voidsetSeparator(String separator)
-
-
-
Field Detail
-
caseSensitive
protected boolean caseSensitive
Whether or not the file system should be treated as a case sensitive one.
-
separator
protected String separator
The file separator to use to parse paths - default=local O/S separator
-
-
Method Detail
-
setIncludes
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 matchFile.separatorChar.When a pattern ends with a '/' or '\', "**" is appended.
- Parameters:
includes- A list of include patterns. May benull, indicating that all files should be included. If a non-nulllist is given, all elements must be non-null.
-
setIncludes
public void setIncludes(Collection<String> includes)
-
isCaseSensitive
public boolean isCaseSensitive()
- Returns:
- Whether or not the file system should be treated as a case sensitive one.
-
setCaseSensitive
public void setCaseSensitive(boolean caseSensitive)
-
getSeparator
public String getSeparator()
- Returns:
- The file separator to use to parse paths - default=local O/S separator
-
setSeparator
public void setSeparator(String separator)
-
isIncluded
protected boolean isIncluded(String name)
Tests whether or not a name matches against at least one include pattern.- Parameters:
name- The name to match. Must not benull.- Returns:
truewhen the name matches against at least one include pattern, orfalseotherwise.
-
couldHoldIncluded
protected boolean couldHoldIncluded(String name)
Tests whether or not a name matches the start of at least one include pattern.- Parameters:
name- The name to match. Must not benull.- Returns:
truewhen the name matches against the start of at least one include pattern, orfalseotherwise.
-
-