Class BeginEndPathConstraint
- java.lang.Object
-
- edu.wisc.library.ocfl.core.path.constraint.BeginEndPathConstraint
-
- All Implemented Interfaces:
FileNameConstraint,PathConstraint
public class BeginEndPathConstraint extends Object implements PathConstraint, FileNameConstraint
Validates that a path or filename does or does not begin or and with a specified value
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapply(String path)Validates that a path meets a defined constraintvoidapply(String fileName, String path)Validates that a filename meets a defined constraintstatic BeginEndPathConstraintmustBeginWith(String prefix)Creates a new constraint that validates that a path DOES begin with a specified prefixstatic BeginEndPathConstraintmustEndWith(String suffix)Creates a new constraint that validates that a path DOES end with a specified suffixstatic BeginEndPathConstraintmustNotBeginWith(String prefix)Creates a new constraint that validates that a path DOES NOT begin with a specified prefixstatic BeginEndPathConstraintmustNotEndWith(String suffix)Creates a new constraint that validates that a path DOES NOT end with a specified suffix
-
-
-
Method Detail
-
mustNotEndWith
public static BeginEndPathConstraint mustNotEndWith(String suffix)
Creates a new constraint that validates that a path DOES NOT end with a specified suffix- Parameters:
suffix- the suffix to test for- Returns:
- constraint
-
mustEndWith
public static BeginEndPathConstraint mustEndWith(String suffix)
Creates a new constraint that validates that a path DOES end with a specified suffix- Parameters:
suffix- the suffix to test for- Returns:
- constraint
-
mustNotBeginWith
public static BeginEndPathConstraint mustNotBeginWith(String prefix)
Creates a new constraint that validates that a path DOES NOT begin with a specified prefix- Parameters:
prefix- the prefix to test for- Returns:
- constraint
-
mustBeginWith
public static BeginEndPathConstraint mustBeginWith(String prefix)
Creates a new constraint that validates that a path DOES begin with a specified prefix- Parameters:
prefix- the prefix to test for- Returns:
- constraint
-
apply
public void apply(String path)
Validates that a path meets a defined constraint- Specified by:
applyin interfacePathConstraint- Parameters:
path- the path to validate
-
apply
public void apply(String fileName, String path)
Validates that a filename meets a defined constraint- Specified by:
applyin interfaceFileNameConstraint- Parameters:
fileName- the filename to validatepath- the path the filename is part of. This is supplied for context and is not validated
-
-