Package org.apache.commons.text.lookup
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
Abstracts string lookup that guards Path lookups with a fence.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final PathFenceA fence is made of Paths guarding Path resolution.Fields inherited from class org.apache.commons.text.lookup.AbstractStringLookup
SPLIT_CH, SPLIT_STR -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.commons.text.lookup.AbstractStringLookup
substringAfter, substringAfter, substringAfterLast, toLookupKey, toLookupKeyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.commons.text.lookup.StringLookup
apply, lookup
-
Field Details
-
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
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.
-