Class PathValidator

java.lang.Object
ai.vespa.validation.PathValidator

public class PathValidator extends Object
Path validations
Author:
mortent
  • Constructor Details

    • PathValidator

      public PathValidator()
  • Method Details

    • validateChildOf

      public static void validateChildOf(Path root, Path path)
      Validate that file is a child of basedir
      Parameters:
      root - Root directory to use for validation
      path - Path to validate
      Throws:
      IllegalArgumentException - if path is not a child of root
    • resolveChildOf

      public static Path resolveChildOf(Path root, String path)
      Resolves a path under a root path
      Parameters:
      root - root poth
      path - child to resolve
      Returns:
      The resolved path
      Throws:
      IllegalArgumentException - If the provided child path does not resolve as child of root