Top Description Fields Constructors Methods
org.apache.commons.text.lookup

pack-priv abstract Class AbstractPathFencedLookup

extends AbstractStringLookup
Class Inheritance
Known Direct Subclasses
org.apache.commons.text.lookup.FileStringLookup, org.apache.commons.text.lookup.PropertiesStringLookup, org.apache.commons.text.lookup.XmlStringLookup
Imports
java.nio.file.Path

Abstracts string lookup that guards Path lookups with a fence.

Field Summary

Modifier and TypeField and Description
protected final PathFence
fence

A fence is made of Paths guarding Path resolution.

Inherited from org.apache.commons.text.lookup.AbstractStringLookup:
SPLIT_CHSPLIT_STR

Constructor Summary

AccessConstructor and Description
pack-priv
AbstractPathFencedLookup(final Path...
The fences guarding Path resolution.
paths
)

Constructs a new instance.

Method Summary

Modifier and TypeMethod and Description
protected Path

Returns:

a fenced Path.
getPath
(final String
the file name to resolve.
fileName
)

Gets a Path for the given file name checking that it resolves within our fence.

Inherited from org.apache.commons.text.lookup.AbstractStringLookup:
substringAftersubstringAftersubstringAfterLasttoLookupKeytoLookupKey

Field Detail

fenceback to summary
protected final PathFence fence

A fence is made of Paths guarding Path resolution.

Constructor Detail

AbstractPathFencedLookupback to summary
pack-priv AbstractPathFencedLookup(final Path... paths)

Constructs a new instance.

Parameters
paths:Path[]

The fences guarding Path resolution.

Method Detail

getPathback to summary
protected Path getPath(final String fileName)

Gets a Path for the given file name checking that it resolves within our fence.

Parameters
fileName:String

the file name to resolve.

Returns:Path

a fenced Path.

Exceptions
IllegalArgumentException:
if the file name is not without our fence.