Package com.owenfeehan.pathpatternfinder
Class SplitDirectoriesHelper
Object
com.owenfeehan.pathpatternfinder.SplitDirectoriesHelper
public class SplitDirectoriesHelper extends Object
Splits a constant string by directory-separators into multiple elements.
- Author:
- Owen Feehan
-
Method Summary
Modifier and Type Method Description static Pattern
buildPatternFromPath(Path path)
Builds a pattern from a string by parsing it and splitting into separate directories.static void
splitStringIntoElements(String stringToParse, Consumer<PatternElement> elementConsumer)
Parses a string so that any characters matching the path separation are added separately.
-
Method Details
-
buildPatternFromPath
Builds a pattern from a string by parsing it and splitting into separate directories.- Parameters:
path
- the path to build ap attern from- Returns:
- a newly created pattern
-
splitStringIntoElements
public static void splitStringIntoElements(String stringToParse, Consumer<PatternElement> elementConsumer)Parses a string so that any characters matching the path separation are added separately.- Parameters:
stringToParse
- the constant string to addelementConsumer
- called to add each element
-