- java.lang.Object
-
- com.pervasive.datarush.io.UnixStyleGlobbing.GlobDefinition
-
- Enclosing class:
- UnixStyleGlobbing
public abstract static class UnixStyleGlobbing.GlobDefinition extends Object
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
Constructors Modifier Constructor Description protected
GlobDefinition(String globPattern, String separators, String prefix)
Defines a new globbing pattern.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description List<String>
getElementPatterns()
Gets the globbing patterns for each element.abstract Path
getRootPath()
Gets the initial path from which globbing starts.protected String
parseDirectoryPattern(String pattern, int start, int end)
Identifies the next element pattern between specified locations.protected void
parsePattern(String pattern, List<String> directoryPatterns)
Breaks a full globbing pattern into individual per-directory elements.
-
-
-
Constructor Detail
-
GlobDefinition
protected GlobDefinition(String globPattern, String separators, String prefix)
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 Detail
-
getRootPath
public abstract Path 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
public List<String> getElementPatterns()
Gets the globbing patterns for each element.- Returns:
-
parseDirectoryPattern
protected final String parseDirectoryPattern(String pattern, int start, int end)
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
-
-