Class PathConstraintProcessor


  • public class PathConstraintProcessor
    extends Object
    A PathConstraintProcessor is used to apply a preconfigured set of constraints to a given path. If the path fails to meet a constraint, a PathConstraintException is thrown.
    • Method Detail

      • apply

        public String apply​(String path)
        Applies all of the configured constraints on the path. If one of them fails, then a PathConstraintException is thrown.
        Parameters:
        path - the path to apply constraints to
        Returns:
        the input path
        Throws:
        PathConstraintException - when a constraint fails
      • prependPathConstraint

        public PathConstraintProcessor prependPathConstraint​(PathConstraint pathConstraint)
        Adds a new path constraint to the beginning of the list of path constraints
        Parameters:
        pathConstraint - constraint to add
        Returns:
        this
      • prependFileNameConstraint

        public PathConstraintProcessor prependFileNameConstraint​(FileNameConstraint fileNameConstraint)
        Adds a new filename constraint to the beginning of the list of filename constraints
        Parameters:
        fileNameConstraint - constraint to add
        Returns:
        this
      • prependCharConstraint

        public PathConstraintProcessor prependCharConstraint​(PathCharConstraint charConstraint)
        Adds a new character constraint to the beginning of the list of character constraints
        Parameters:
        charConstraint - constraint to add
        Returns:
        this
      • appendPathConstraint

        public PathConstraintProcessor appendPathConstraint​(PathConstraint pathConstraint)
        Adds a new path constraint to the end of the list of path constraints
        Parameters:
        pathConstraint - constraint to add
        Returns:
        this
      • appendFileNameConstraint

        public PathConstraintProcessor appendFileNameConstraint​(FileNameConstraint fileNameConstraint)
        Adds a new filename constraint to the end of the list of filename constraints
        Parameters:
        fileNameConstraint - constraint to add
        Returns:
        this
      • appendCharConstraint

        public PathConstraintProcessor appendCharConstraint​(PathCharConstraint charConstraint)
        Adds a new character constraint to the end of the list of character constraints
        Parameters:
        charConstraint - constraint to add
        Returns:
        this