Package org.codehaus.mojo.wagon.shared
Class SelectorUtils
java.lang.Object
org.codehaus.mojo.wagon.shared.SelectorUtils
A copy of plexus-util's SelectorUtils to deal with unix file separator only.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanTests whether or not a string matches against a pattern.static booleanTests whether or not a string matches against a pattern.static booleanTests whether or not a given path matches a given pattern.static booleanTests whether or not a given path matches a given pattern.static booleanmatchPatternStart(String pattern, String str) Tests whether or not a given path matches the start of a given pattern up to the first "**".static booleanmatchPatternStart(String pattern, String str, boolean isCaseSensitive) Tests whether or not a given path matches the start of a given pattern up to the first "**".tokenizePath(String path) Breaks a path up into a Vector of path elements, tokenizing onFile.separator.
-
Constructor Details
-
SelectorUtils
public SelectorUtils()
-
-
Method Details
-
matchPatternStart
Tests whether or not a given path matches the start of a given pattern up to the first "**".This is not a general purpose test and should only be used if you can live with false positives. For example,
pattern=**\aandstr=bwill yieldtrue.- Parameters:
pattern- The pattern to match against. Must not benull.str- The path to match, as a String. Must not benull.- Returns:
- whether or not a given path matches the start of a given pattern up to the first "**".
-
matchPatternStart
Tests whether or not a given path matches the start of a given pattern up to the first "**".This is not a general purpose test and should only be used if you can live with false positives. For example,
pattern=**\aandstr=bwill yieldtrue.- Parameters:
pattern- The pattern to match against. Must not benull.str- The path to match, as a String. Must not benull.isCaseSensitive- Whether or not matching should be performed case sensitively.- Returns:
- whether or not a given path matches the start of a given pattern up to the first "**".
-
matchPath
Tests whether or not a given path matches a given pattern.- Parameters:
pattern- The pattern to match against. Must not benull.str- The path to match, as a String. Must not benull.- Returns:
trueif the pattern matches against the string, orfalseotherwise.
-
matchPath
Tests whether or not a given path matches a given pattern.- Parameters:
pattern- The pattern to match against. Must not benull.str- The path to match, as a String. Must not benull.isCaseSensitive- Whether or not matching should be performed case sensitively.- Returns:
trueif the pattern matches against the string, orfalseotherwise.
-
match
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- The pattern to match against. Must not benull.str- The string which must be matched against the pattern. Must not benull.- Returns:
trueif the string matches against the pattern, orfalseotherwise.
-
match
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- The pattern to match against. Must not benull.str- The string which must be matched against the pattern. Must not benull.isCaseSensitive- Whether or not matching should be performed case sensitively.- Returns:
trueif the string matches against the pattern, orfalseotherwise.
-
tokenizePath
Breaks a path up into a Vector of path elements, tokenizing onFile.separator.- Parameters:
path- Path to tokenize. Must not benull.- Returns:
- a Vector of path elements from the tokenized path
-