Class PathFence
java.lang.Object
org.apache.commons.text.lookup.PathFence
A Path fence guards against using paths outside of a "fence" of made of root paths.
Keep package-private.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final classBuildsPathFenceinstances. -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivatePathFence(PathFence.Builder builder) Constructs a new instance. -
Method Summary
Modifier and TypeMethodDescription(package private) PathGets a Path for the given file name checking that it resolves within our fence.(package private) static PathFence.Builderbuilder()Creates a new builder.
-
Field Details
-
roots
-
-
Constructor Details
-
PathFence
Constructs a new instance.- Parameters:
builder- A builder.
-
-
Method Details
-
builder
-
apply
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.
-