java.lang.Object
com.pervasive.datarush.io.UnixStyleGlobbing.GlobDefinition
- Enclosing class:
- UnixStyleGlobbing
Provides information for performing globbing. This class parses glob patterns
into a sequence of element patterns to be applied.
File systems implementations should implement a subclass of this one to provide parsing of glob patterns appropriate for their pathing syntax.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedGlobDefinition(String globPattern, String separators, String prefix) Defines a new globbing pattern. -
Method Summary
Modifier and TypeMethodDescriptionGets the globbing patterns for each element.abstract PathGets the initial path from which globbing starts.protected final StringparseDirectoryPattern(String pattern, int start, int end) Identifies the next element pattern between specified locations.protected voidparsePattern(String pattern, List<String> directoryPatterns) Breaks a full globbing pattern into individual per-directory elements.
-
Constructor Details
-
GlobDefinition
Defines a new globbing pattern.- Parameters:
globPattern- the full pattern for matchingseparators- valid path element separatorsprefix- a prefix to remove from the pattern, if present. Normally, this would be the file system prefix which, if removed, leaves only the hierarchical path.
-
-
Method Details
-
getRootPath
Gets the initial path from which globbing starts. Typically, this would be the root of the file system.- Returns:
- the root path for applying globbing
-
getElementPatterns
Gets the globbing patterns for each element.- Returns:
-
parseDirectoryPattern
Identifies the next element pattern between specified locations.- Parameters:
pattern- the complete globbing patternstart- the index of the first character in the elementend- the upper bound on the element index- Returns:
- the element pattern
-
parsePattern
Breaks a full globbing pattern into individual per-directory elements.- Parameters:
pattern- the pattern to parsedirectoryPatterns- the container into which to store the path element patterns.
-