Package io.ocfl.core.path.constraint
Class ContentPathConstraints
java.lang.Object
io.ocfl.core.path.constraint.ContentPathConstraints
This class provides default path constraints that can be applied to OCFL content paths to attempt to ensure portability
across various filesystems. It is useful to apply constraints for filesystems other than the local filesystem,
as the local filesystem will readily enforce its own constraints.
The constraints defined here are generalizations and do not exhaustively target specific filesystems. If you have specific needs that are not addressed here, create a custom ContentPathConstraintProcessor.
The following constraints are ALWAYS applied:
- Cannot have a leading OR trailing /
- Cannot contain the following filenames: '.', '..'
- Cannot contain an empty filename
- Windows only: Cannot contain a \
-
Method Summary
Modifier and TypeMethodDescriptionall()
Constructs a ContentPathConstraintProcessor that applies the minimum path constraints across Unix, Windows, and cloud filesystems.cloud()
Constructs a ContentPathConstraintProcessor that applies the minimum path constraints across cloud providers (Amazon, Azure, Google).minimal()
Constructs a ContentPathConstraintProcessor that does the minimal content path validations as required by the OCFL spec.unix()
Constructs a ContentPathConstraintProcessor that applies the minimum path constraints on a unix based filesystem.windows()
Constructs a ContentPathConstraintProcessor that applies the minimum path constraints on a Windows based filesystem.
-
Method Details
-
unix
Constructs a ContentPathConstraintProcessor that applies the minimum path constraints on a unix based filesystem. This does not guarantee that every path that passes validation will work on any unix based filesystem, but the most problematic characters are prohibited.- Returns:
- ContentPathConstraintProcessor
-
windows
Constructs a ContentPathConstraintProcessor that applies the minimum path constraints on a Windows based filesystem. This does not guarantee that every path that passes validation will work on any Windows based filesystem, but the most problematic characters are prohibited.- Returns:
- ContentPathConstraintProcessor
-
cloud
Constructs a ContentPathConstraintProcessor that applies the minimum path constraints across cloud providers (Amazon, Azure, Google). This does not guarantee that every path that passes validation will work with all cloud providers, but the most problematic characters are prohibited.- Returns:
- ContentPathConstraintProcessor
-
all
Constructs a ContentPathConstraintProcessor that applies the minimum path constraints across Unix, Windows, and cloud filesystems. This does not guarantee that every path that passes validation will work on any filesystem, but the most problematic characters across systems are prohibited.- Returns:
- ContentPathConstraintProcessor
-
minimal
Constructs a ContentPathConstraintProcessor that does the minimal content path validations as required by the OCFL spec.- Cannot have a leading OR trailing /
- Cannot contain the following filenames: '.', '..'
- Cannot contain an empty filename
- Windows only: Cannot contain a \
- Returns:
- ContentPathConstraintProcessor
-