OSFI-Java
3.9.2
OpenSF Integration Library
|
Public Member Functions | |
CLP (final String[] args) | |
List< String > | parseFiles (final String arg) |
void | checkValidFile (final String file) |
String | getConfFile () |
List< String > | getConfFiles () |
List< String > | getInputFiles () |
List< String > | getOutputFiles () |
Provides procedures to parse the command line arguments, generating a list of tokens grouped as:
The command line could follow one of the two versions supported. If an option is detected in the arguments, version 2 is used, otherwise version 1 is used.
Command line must follow the following format (expressed in Extended Backus-Naur form):
<command_line> ::= <executable_name> <whitespaces> <configuration_files> <whitespaces><input_files> <whitespaces> <output_files> <EOL><executable_name> ::= <file_name><whitespace> ::= (" ")<whitespaces> ::= <whitespace>+<file_name> ::= (<alphanumeric>)+<configuration_files> ::= <list_of_files><input_files> ::= <list_of_files><output_files> ::= <list_of_files><list_of_files> ::= <file_name> ("," <file_name>)*
In order to increase the flexibility of the OpenSF/Modules CLI, the following new CLI should be adopted:
<command_line> ::= <executable> <options><options> ::= (<global_configuration> | <local_configuration> | <input_file> | <output_file>)*<executable>> ::= <file_name><global_configuration> ::= (--global|-g) <file_name><local_configuration> ::= (--local|-l) <file_name><input_file> ::= (--input|-i) <file_name><output_file> ::= (--output|-o) <file_name><file_name> ::= (<alphanumeric>)+
Notice: the above specification allows for multiple -global/-local options. In case multiple options are defined, a complying implementation considers the value of the last option specified.
File names must be valid OS-dependant file locations. Per the E2E-ICD, the configuration, input and output file names can be either a full-path name or a relative path name. Relative path names are interpreted by the module as relative to the current working directory. In particular, no reference to the possible
variable is made.
esa.opensf.osfi.CLP.CLP | ( | final String[] | args | ) |
Parse the command line arguments into the configuration, input and output files.
args | Arguments array as passed to the main
|
IllegalArgumentException | if the arguments are invalid |
References esa.opensf.osfi.CLP.parseFiles(), and esa.opensf.osfi.Logger.warning().
void esa.opensf.osfi.CLP.checkValidFile | ( | final String | file | ) |
Checks the OS validity of a file name.
file | file name to validate |
IllegalArgumentException | in case of invalid file name. |
String esa.opensf.osfi.CLP.getConfFile | ( | ) |
Gets the name of the configuration file. Configuration file can be "" is no configuration file is passed.
List<String> esa.opensf.osfi.CLP.getConfFiles | ( | ) |
Gets the list of the configuration files. When CLI v2 is used, the list always contain 2 elements: the global configuration file followed by the local one. One or both strings could be null if no file is provided.
List<String> esa.opensf.osfi.CLP.getInputFiles | ( | ) |
Gets the list of the input files.
List<String> esa.opensf.osfi.CLP.getOutputFiles | ( | ) |
Gets the list of the output files.
List<String> esa.opensf.osfi.CLP.parseFiles | ( | final String | arg | ) |
Parses a string to obtain a list of tokenized strings, separated by a delimiter.
IllegalArgumentException | in case of invalid files. |
References esa.opensf.osfi.Logger.debug().