public final class PathValidator
extends java.lang.Object
Path objects and the like.| Modifier and Type | Method and Description |
|---|---|
static java.nio.file.Path |
isDirectoryPath(java.lang.String input,
MessageFormatter message)
Make sure input is a directory path.
|
static java.nio.file.Path |
isPath(java.nio.file.Path basePath,
java.lang.String input,
MessageFormatter message)
Make sure input is a valid relative path.
|
static java.nio.file.Path |
isPath(java.lang.String input,
MessageFormatter message)
Make sure input is a valid path.
|
static java.nio.file.Path |
isReadablePath(java.lang.String input,
MessageFormatter message)
Make sure input is a readable path.
|
static java.nio.file.Path |
isRegularFilePath(java.lang.String input,
MessageFormatter message)
Make sure input is a file path.
|
static java.nio.file.Path |
isWritablePath(java.lang.String input,
MessageFormatter message)
Make sure input is a writable path.
|
public static java.nio.file.Path isPath(java.lang.String input,
MessageFormatter message)
throws ValidationException
input - The input to validate.message - The exception message to use if the input is invalid.Path object.ValidationException - if the input is invalid.public static java.nio.file.Path isPath(java.nio.file.Path basePath,
java.lang.String input,
MessageFormatter message)
throws ValidationException
basePath - The base path to validate the input against.input - The input to validate.message - The exception message to use if the input is invalid.Path object.ValidationException - if the input is invalid.public static java.nio.file.Path isRegularFilePath(java.lang.String input,
MessageFormatter message)
throws ValidationException
input - The input to validate.message - The exception message to use if the input is invalid.Path object.ValidationException - if the input is invalid.Files.isRegularFile(Path, java.nio.file.LinkOption...)public static java.nio.file.Path isDirectoryPath(java.lang.String input,
MessageFormatter message)
throws ValidationException
input - The input to validate.message - The exception message to use if the input is invalid.Path object.ValidationException - if the input is invalid.Files.isReadable(Path)public static java.nio.file.Path isReadablePath(java.lang.String input,
MessageFormatter message)
throws ValidationException
input - The input to validate.message - The exception message to use if the input is invalid.Path object.ValidationException - if the input is invalid.Files.isReadable(Path)public static java.nio.file.Path isWritablePath(java.lang.String input,
MessageFormatter message)
throws ValidationException
input - The input to validate.message - The exception message to use if the input is invalid.Path object.ValidationException - if the input is invalid.Files.isWritable(Path)