Class AbstractPathFencedLookup

java.lang.Object
org.apache.commons.text.lookup.AbstractStringLookup
org.apache.commons.text.lookup.AbstractPathFencedLookup
All Implemented Interfaces:
Function<String,String>, UnaryOperator<String>, StringLookup
Direct Known Subclasses:
FileStringLookup, PropertiesStringLookup, XmlStringLookup

abstract class AbstractPathFencedLookup extends AbstractStringLookup
Abstracts string lookup that guards Path lookups with a fence.
  • Field Details

    • fence

      protected final PathFence fence
      A fence is made of Paths guarding Path resolution.
  • Constructor Details

    • AbstractPathFencedLookup

      AbstractPathFencedLookup(Path... paths)
      Constructs a new instance.
      Parameters:
      paths - The fences guarding Path resolution.
  • Method Details

    • getPath

      protected Path getPath(String fileName)
      Gets a Path for the given file name checking that it resolves within our fence.
      Parameters:
      fileName - the file name to resolve.
      Returns:
      a fenced Path.
      Throws:
      IllegalArgumentException - if the file name is not without our fence.