Top Description Constructors Methods
io.vertx.core.impl.launcher.commands

public final Class FileSelector

extends Object
Class Inheritance
Imports
java.io.File, java.util.ArrayList, .List, .StringTokenizer

Utility methods to test path matching. This is used by the Watcher to determine whether or not a file triggers a redeployment.
Author
Clement Escoffier

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static boolean
checkOnlyStartsLeft(char[] patArr, int patIdxStart, int patIdxEnd)

private static boolean
equals(char c1, char c2, boolean isCaseSensitive)

Tests whether two characters are equal.

public static boolean

Returns:

true if the string matches against the pattern, or false otherwise.
match
(String
The pattern to match against. Must not benull.
pattern
,
String
The string which must be matched against the pattern. Must not benull.
str
)

Tests whether or not a string matches against a pattern.

public static boolean

Returns:

true if the string matches against the pattern, or false otherwise.
match
(String
The pattern to match against. Must not benull.
pattern
,
String
The string which must be matched against the pattern. Must not benull.
str
,
boolean
Whether or not matching should be performed case sensitively.
isCaseSensitive
)

Tests whether or not a string matches against a pattern.

private static boolean
match(char[] patArr, char[] strArr, boolean isCaseSensitive)

public static boolean

Returns:

true if the pattern matches against the string, or false otherwise.
matchPath
(String
The pattern to match against. Must not be null.
pattern
,
String
The path to match, as a String. Must not be null.
str
)

Tests whether or not a given path matches a given pattern.

public static boolean

Returns:

true if the pattern matches against the string, or false otherwise.
matchPath
(String
The pattern to match against. Must not be null.
pattern
,
String
The path to match, as a String. Must not be null.
str
,
boolean
Whether or not matching should be performed case sensitively.
isCaseSensitive
)

Tests whether or not a given path matches a given pattern.

protected static boolean
matchPath(String pattern, String str, String separator, boolean isCaseSensitive)

private static boolean
matchPathPattern(String pattern, String str, String separator, boolean isCaseSensitive)

private static boolean
matchPathPattern(String[] patDirs, String[] strDirs, boolean isCaseSensitive)

private static boolean

Returns:

true when @{code str} starts with a File#separator, and pattern starts with a File#separator.
separatorPatternStartSlashMismatch
(String pattern, String str, String separator)

When the pattern starts with a File#separator, str has to start with a File#separator.

private static String[]
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

FileSelectorback to summary
public FileSelector()

Method Detail

checkOnlyStartsLeftback to summary
private static boolean checkOnlyStartsLeft(char[] patArr, int patIdxStart, int patIdxEnd)
equalsback to summary
private static boolean equals(char c1, char c2, boolean isCaseSensitive)

Tests whether two characters are equal.

matchback to summary
public static boolean match(String pattern, String str)

Tests whether or not a string matches against a pattern. The pattern may contain two special characters:
'*' means zero or more characters
'?' means one and only one character

Parameters
pattern:String

The pattern to match against. Must not benull.

str:String

The string which must be matched against the pattern. Must not benull.

Returns:boolean

true if the string matches against the pattern, or false otherwise.

matchback to summary
public static boolean match(String pattern, String str, boolean isCaseSensitive)

Tests whether or not a string matches against a pattern. The pattern may contain two special characters:
'*' means zero or more characters
'?' means one and only one character

Parameters
pattern:String

The pattern to match against. Must not benull.

str:String

The string which must be matched against the pattern. Must not benull.

isCaseSensitive:boolean

Whether or not matching should be performed case sensitively.

Returns:boolean

true if the string matches against the pattern, or false otherwise.

matchback to summary
private static boolean match(char[] patArr, char[] strArr, boolean isCaseSensitive)
matchPathback to summary
public static boolean matchPath(String pattern, String str)

Tests whether or not a given path matches a given pattern.

Parameters
pattern:String

The pattern to match against. Must not be null.

str:String

The path to match, as a String. Must not be null.

Returns:boolean

true if the pattern matches against the string, or false otherwise.

matchPathback to summary
public static boolean matchPath(String pattern, String str, boolean isCaseSensitive)

Tests whether or not a given path matches a given pattern.

Parameters
pattern:String

The pattern to match against. Must not be null.

str:String

The path to match, as a String. Must not be null.

isCaseSensitive:boolean

Whether or not matching should be performed case sensitively.

Returns:boolean

true if the pattern matches against the string, or false otherwise.

matchPathback to summary
protected static boolean matchPath(String pattern, String str, String separator, boolean isCaseSensitive)
matchPathPatternback to summary
private static boolean matchPathPattern(String pattern, String str, String separator, boolean isCaseSensitive)
matchPathPatternback to summary
private static boolean matchPathPattern(String[] patDirs, String[] strDirs, boolean isCaseSensitive)
separatorPatternStartSlashMismatchback to summary
private static boolean separatorPatternStartSlashMismatch(String pattern, String str, String separator)

When the pattern starts with a File#separator, str has to start with a File#separator.

Returns:boolean

true when @{code str} starts with a File#separator, and pattern starts with a File#separator.

tokenizePathToStringback to summary
private static String[] tokenizePathToString(String path, String separator)