Package io.ocfl.core.path.constraint
Class BeginEndPathConstraint
java.lang.Object
io.ocfl.core.path.constraint.BeginEndPathConstraint
- All Implemented Interfaces:
FileNameConstraint
,PathConstraint
Validates that a path or filename does or does not begin or and with a specified value
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Validates that a path meets a defined constraintvoid
Validates that a filename meets a defined constraintstatic BeginEndPathConstraint
mustBeginWith
(String prefix) Creates a new constraint that validates that a path DOES begin with a specified prefixstatic BeginEndPathConstraint
mustEndWith
(String suffix) Creates a new constraint that validates that a path DOES end with a specified suffixstatic BeginEndPathConstraint
mustNotBeginWith
(String prefix) Creates a new constraint that validates that a path DOES NOT begin with a specified prefixstatic BeginEndPathConstraint
mustNotEndWith
(String suffix) Creates a new constraint that validates that a path DOES NOT end with a specified suffix
-
Method Details
-
mustNotEndWith
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
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
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
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
Validates that a path meets a defined constraint- Specified by:
apply
in interfacePathConstraint
- Parameters:
path
- the path to validate
-
apply
Validates that a filename meets a defined constraint- Specified by:
apply
in interfaceFileNameConstraint
- Parameters:
fileName
- the filename to validatepath
- the path the filename is part of. This is supplied for context and is not validated
-