Class TrimCommonPathRoot

Object
com.owenfeehan.pathpatternfinder.trim.TrimCommonPathRoot
All Implemented Interfaces:
TrimOperation<Path>

public class TrimCommonPathRoot
extends Object
implements TrimOperation<Path>
Considers each element of a file-path (between directory separators) as an ordered list and finds a the maximally constant sublist from the left size.

Only directories are considered. The file-name (the final element in a path) is ignored.

Author:
Owen Feehan
  • Constructor Details

    • TrimCommonPathRoot

      public TrimCommonPathRoot​(UnresolvedPatternElementFactory factory, boolean avoidExtensionSplit)
      Create for a specific factory.
      Parameters:
      factory - the factory.
      avoidExtensionSplit - if true, splits will be avoided in file extensions in the paths (defined as anything after the right-most period)
  • Method Details