Top Fields Constructors Methods
org.apache.sshd.common.util.io

public abstract Class PathScanningMatcher

extends Object
Class Inheritance
Known Direct Subclasses
org.apache.sshd.common.util.io.DirectoryScanner
Imports
java.io.File, java.util.ArrayList, .Arrays, .Collection, .Collections, .List, java.util.stream.Collectors, org.apache.sshd.common.util.GenericUtils, .OsUtils, .SelectorUtils, .ValidateUtils

Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField 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

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
protected boolean

Returns:

true when the name matches against the start of at least one include pattern, or false otherwise.
couldHoldIncluded
(String
The name to match. Must not be null.
name
)

Tests whether or not a name matches the start of at least one include pattern.

public List<String>

Returns:

Un-modifiable list of the inclusion patterns
getIncludes
()

public String

Returns:

The file separator to use to parse paths - default=local O/S separator
getSeparator
()

public boolean

Returns:

Whether or not the file system should be treated as a case sensitive one.
isCaseSensitive
()

protected boolean

Returns:

true when the name matches against at least one include pattern, or false otherwise.
isIncluded
(String
The name to match. Must not be null.
name
)

Tests whether or not a name matches against at least one include pattern.

public static String

Returns:

The normalized pattern, never null.
normalizePattern
(String
The pattern to normalize, must not be null.
pattern
)

Normalizes the pattern, e.g. converts forward and backward slashes to the platform-specific file separator.

public void
setCaseSensitive(boolean caseSensitive)

public void
setIncludes(String...
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.
includes
)

Sets the list of include patterns to use.

public void
public void
setSeparator(String separator)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

caseSensitiveback to summary
protected boolean caseSensitive

Whether or not the file system should be treated as a case sensitive one.

includePatternsback to summary
protected List<String> includePatterns

The patterns for the files to be included.

separatorback to summary
protected String separator

The file separator to use to parse paths - default=local O/S separator

Constructor Detail

PathScanningMatcherback to summary
protected PathScanningMatcher()

Method Detail

couldHoldIncludedback to summary
protected boolean couldHoldIncluded(String name)

Tests whether or not a name matches the start of at least one include pattern.

Parameters
name:String

The name to match. Must not be null.

Returns:boolean

true when the name matches against the start of at least one include pattern, or false otherwise.

getIncludesback to summary
public List<String> getIncludes()
Returns:List<String>

Un-modifiable list of the inclusion patterns

getSeparatorback to summary
public String getSeparator()
Returns:String

The file separator to use to parse paths - default=local O/S separator

isCaseSensitiveback to summary
public boolean isCaseSensitive()
Returns:boolean

Whether or not the file system should be treated as a case sensitive one.

isIncludedback to summary
protected boolean isIncluded(String name)

Tests whether or not a name matches against at least one include pattern.

Parameters
name:String

The name to match. Must not be null.

Returns:boolean

true when the name matches against at least one include pattern, or false otherwise.

normalizePatternback to summary
public static String normalizePattern(String pattern)

Normalizes the pattern, e.g. converts forward and backward slashes to the platform-specific file separator.

Parameters
pattern:String

The pattern to normalize, must not be null.

Returns:String

The normalized pattern, never null.

setCaseSensitiveback to summary
public void setCaseSensitive(boolean caseSensitive)
setIncludesback to summary
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.

Parameters
includes:String[]

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.

setIncludesback to summary
public void setIncludes(Collection<String> includes)
setSeparatorback to summary
public void setSeparator(String separator)