Class ContentPathConstraints
- java.lang.Object
-
- edu.wisc.library.ocfl.core.path.constraint.ContentPathConstraints
-
public final class ContentPathConstraints extends Object
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
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ContentPathConstraintProcessorall()Constructs a ContentPathConstraintProcessor that applies the minimum path constraints across Unix, Windows, and cloud filesystems.static ContentPathConstraintProcessorcloud()Constructs a ContentPathConstraintProcessor that applies the minimum path constraints across cloud providers (Amazon, Azure, Google).static ContentPathConstraintProcessornone()Constructs a ContentPathConstraintProcessor that does no special validation.static ContentPathConstraintProcessorunix()Constructs a ContentPathConstraintProcessor that applies the minimum path constraints on a unix based filesystem.static ContentPathConstraintProcessorwindows()Constructs a ContentPathConstraintProcessor that applies the minimum path constraints on a Windows based filesystem.
-
-
-
Method Detail
-
unix
public static ContentPathConstraintProcessor 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
public static 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
public static 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
public static 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
-
none
public static ContentPathConstraintProcessor none()
Constructs a ContentPathConstraintProcessor that does no special validation.- Returns:
- ContentPathConstraintProcessor
-
-