Class FileOption
java.lang.Object
eu.svjatoslav.commons.cli_helper.parameter_parser.Option<File,FileOption>
eu.svjatoslav.commons.cli_helper.parameter_parser.parameter.FileOption
This class represents commandline option which accepts exactly one parameter
which is a file.
-
Field Summary
Fields inherited from class eu.svjatoslav.commons.cli_helper.parameter_parser.Option
description, mandatory, parameters
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetValue()
Returns the value of the object.boolean
This method sets that file shall exist.This method sets that file shall not exist.protected static boolean
validateFile
(ExistenceType existenceType, String value) Methods inherited from class eu.svjatoslav.commons.cli_helper.parameter_parser.Option
addAliases, addParameter, getAliasesAsString, getHelp, isMandatory, isPresent, matchesAlias, noMoreArguments, setMandatory, setPresent
-
Constructor Details
-
FileOption
-
-
Method Details
-
validateFile
-
describeFormat
- Specified by:
describeFormat
in classOption<File,
FileOption> - Returns:
- Single line parameter type description. For example: "file", "date", "integer", "regular expression", etc..
Note: for argument purpose description there is
Option.description
-
getValue
Description copied from class:Option
Returns the value of the object.- Specified by:
getValue
in classOption<File,
FileOption> - Returns:
- the value of the object.
-
mustExist
This method sets that file shall exist.- Returns:
- This object.
-
mustNotExist
This method sets that file shall not exist.- Returns:
- This object.
-
isValid
- Specified by:
isValid
in classOption<File,
FileOption> - Parameters:
value
- value to validate- Returns:
true
if value is correct,false
otherwise.
-