Package ai.vespa.validation
Class PathValidator
java.lang.Object
ai.vespa.validation.PathValidator
Path validations
- Author:
- mortent
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Path
resolveChildOf
(Path root, String path) Resolves a path under a root pathstatic void
validateChildOf
(Path root, Path path) Validate that file is a child of basedir
-
Constructor Details
-
PathValidator
public PathValidator()
-
-
Method Details
-
validateChildOf
Validate that file is a child of basedir- Parameters:
root
- Root directory to use for validationpath
- Path to validate- Throws:
IllegalArgumentException
- if path is not a child of root
-
resolveChildOf
Resolves a path under a root path- Parameters:
root
- root pothpath
- child to resolve- Returns:
- The resolved path
- Throws:
IllegalArgumentException
- If the provided child path does not resolve as child of root
-