Class FileOptions
java.lang.Object
eu.svjatoslav.commons.cli_helper.parameter_parser.Option<List<File>,FileOptions>
eu.svjatoslav.commons.cli_helper.parameter_parser.parameter.FileOptions
Represents a command-line option that accepts one or more file paths.
-
Field Summary
Fields inherited from class eu.svjatoslav.commons.cli_helper.parameter_parser.Option
description, mandatory, parameters -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionProvides a short description of the expected file format(s).getValue()Returns the list of file paths asFileobjects.booleanValidates a single file path against the configured existence type.Requires that each file must already exist.Requires that each file must not already exist.Methods inherited from class eu.svjatoslav.commons.cli_helper.parameter_parser.Option
addAliases, addParameter, getAliasesAsString, getHelp, isMandatory, isPresent, matchesAlias, noMoreArguments, setMandatory, setPresent
-
Constructor Details
-
FileOptions
Constructs a FileOptions object.- Parameters:
description- a brief description of the option's purpose.
-
-
Method Details
-
describeFormat
Provides a short description of the expected file format(s).- Specified by:
describeFormatin classOption<List<File>,FileOptions> - Returns:
- either "One to many existing files.", "One to many non-existing files.", or "One to many files."
-
getValue
Returns the list of file paths asFileobjects. -
mustExist
Requires that each file must already exist.- Returns:
- this FileOptions instance for chaining
-
mustNotExist
Requires that each file must not already exist.- Returns:
- this FileOptions instance for chaining
-
isValid
Validates a single file path against the configured existence type.- Specified by:
isValidin classOption<List<File>,FileOptions> - Parameters:
value- the parameter string to test- Returns:
trueif valid;falseotherwise
-