Package org.apache.sshd.common.util.io
Class PathScanningMatcher
java.lang.Object
org.apache.sshd.common.util.io.PathScanningMatcher
- Direct Known Subclasses:
DirectoryScanner
,SftpClientDirectoryScanner
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
Whether or not the file system should be treated as a case sensitive one.The patterns for the files to be included.protected String
The file separator to use to parse paths - default=local O/S separator -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
couldHoldIncluded
(String name) Tests whether or not a name matches the start of at least one include pattern.boolean
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
(String... includes) Sets the list of include patterns to use.void
setIncludes
(Collection<String> includes) void
setSeparator
(String separator)
-
Field Details
-
caseSensitive
protected boolean caseSensitiveWhether or not the file system should be treated as a case sensitive one. -
separator
The file separator to use to parse paths - default=local O/S separator -
includePatterns
The patterns for the files to be included.
-
-
Constructor Details
-
PathScanningMatcher
protected PathScanningMatcher()
-
-
Method Details
-
setIncludes
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-null
list is given, all elements must be non-null
.
-
getIncludes
- Returns:
- Un-modifiable list of the inclusion patterns
-
setIncludes
-
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
- Returns:
- The file separator to use to parse paths - default=local O/S separator
-
setSeparator
-
isIncluded
Tests whether or not a name matches against at least one include pattern.- Parameters:
name
- The name to match. Must not benull
.- Returns:
true
when the name matches against at least one include pattern, orfalse
otherwise.
-
couldHoldIncluded
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:
true
when the name matches against the start of at least one include pattern, orfalse
otherwise.
-
normalizePattern
Normalizes the pattern, e.g. converts forward and backward slashes to the platform-specific file separator.- Parameters:
pattern
- The pattern to normalize, must not benull
.- Returns:
- The normalized pattern, never
null
.
-