Class IngestionPathSelector
Patterns match the entire root-relative path, using / separators
and no leading slash. * and ? do not cross directories;
** matches zero or more path segments. A brace group such as
{md,pdf} matches any one of its comma-separated alternatives; each
alternative is literal text and the same tokens, and the group may not be
nested or hold an empty alternative. [, ] and \
are refused. include is evaluated
first; a match in exclude always wins. An empty include list admits
every path; an empty exclude list admits every include match.
matches(String, List, List) ignores case: it lower-cases the
selector and the path one code point at a time (see
foldCase(String)) before matching, so **/*.pdf
admits B.PDF, and a Turkish default locale changes nothing. Under
that rule I, i and İ match one another, the dotless
ı matches only itself, and the final ς matches σ
and Σ.
- Since:
- 0.13.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic PatternCompiles one glob or throws with the offending selector.static PatternCompiles one selector read from a.gitignoreor.tnsignoreline, or throws with the offending selector.static PatterncompileIgnoringCase(String glob) Compiles one glob for case-insensitive matching, or throws with the offending selector as written.static StringLower-cases a selector or a/-normalized relative key one code point at a time withCharacter.toLowerCase(int), which no locale changes, and maps the finalςtoσ.static booleanWhether a/-normalized relative path is admitted.static booleanWhetherrelativePathis admitted by the two selector lists.static StringrelativeKey(Path relativePath) Renders a relative path with/separators, independent of the host filesystem.
-
Method Details
-
compile
Compiles one glob or throws with the offending selector.- Parameters:
glob- selector text- Returns:
- anchored regex
-
compileIgnoreFileSelector
Compiles one selector read from a.gitignoreor.tnsignoreline, or throws with the offending selector.Ignore-file lines keep the
*,**,?contract alone: unlikecompile(String), a brace is refused rather than read as a group. They also match the raw key case-sensitively: unlikecompileIgnoringCase(String),secret.mddoes not dropSECRET.md.- Parameters:
glob- selector text- Returns:
- anchored regex
- Since:
- 0.18.7
-
compileIgnoringCase
Compiles one glob for case-insensitive matching, or throws with the offending selector as written.The pattern matches a key passed through
foldCase(String):compileIgnoringCase("**/*.PDF")matchesfoldCase("docs/B.pdf").- Parameters:
glob- selector text- Returns:
- anchored regex over a lower-cased key
- Since:
- 0.18.7
-
foldCase
Lower-cases a selector or a/-normalized relative key one code point at a time withCharacter.toLowerCase(int), which no locale changes, and maps the finalςtoσ.Each code point folds to exactly one code point, whatever surrounds it, so a selector and a path fold alike and
?still matches one character. Folding never yields*,?,/, a brace or a comma, so a folded selector keeps its glob tokens and brace groups.- Parameters:
text- selector or relative key- Returns:
- the folded text
- Since:
- 0.18.7
-
matches
WhetherrelativePathis admitted by the two selector lists. -
matches
Whether a/-normalized relative path is admitted. Selectors and path are compared afterfoldCase(String). -
relativeKey
Renders a relative path with/separators, independent of the host filesystem.
-