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 Details

    • buildPatternFromPath

      public static Pattern buildPatternFromPath​(Path path)
      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 add
      elementConsumer - called to add each element