public class PathMatchers
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
PathMatchers.NonHiddenMatcher |
Modifier and Type | Field and Description |
---|---|
private static java.nio.file.Path |
EMPTY_PATH |
private static char[] |
GLOB_CHARS |
private static char[] |
SYNTAXED_GLOB_CHARS |
Constructor and Description |
---|
PathMatchers() |
Modifier and Type | Method and Description |
---|---|
private static java.nio.file.Path |
asPath(java.lang.String pattern)
Convert a pattern to a Path object.
|
private static int |
countChars(java.lang.String pattern,
int offset,
char c) |
static java.nio.file.PathMatcher |
getMatcher(java.lang.String rawpattern) |
static java.nio.file.PathMatcher |
getNonHidden() |
static java.nio.file.Path |
getSearchRoot(java.lang.String pattern)
Provide the non-glob / non-regex prefix on the pattern as a Path reference.
|
static boolean |
isAbsolute(java.lang.String pattern)
Tests if provided pattern is an absolute reference (or not)
|
private static boolean |
isGlob(char c,
boolean syntaxed)
Determine if part is a glob pattern.
|
private static final char[] GLOB_CHARS
private static final char[] SYNTAXED_GLOB_CHARS
private static final java.nio.file.Path EMPTY_PATH
private static java.nio.file.Path asPath(java.lang.String pattern)
pattern
- the raw pattern (can contain "glob:" or "regex:" syntax indicator)public static java.nio.file.PathMatcher getMatcher(java.lang.String rawpattern)
public static java.nio.file.PathMatcher getNonHidden()
public static java.nio.file.Path getSearchRoot(java.lang.String pattern)
pattern
- the pattern to testprivate static int countChars(java.lang.String pattern, int offset, char c)
public static boolean isAbsolute(java.lang.String pattern)
pattern
- the pattern to testprivate static boolean isGlob(char c, boolean syntaxed)
part
- the string to checksyntaxed
- true if overall pattern is syntaxed with "glob:"
or "regex:"