OSFI-Java  3.9.2
OpenSF Integration Library
esa.opensf.osfi.CLP Class Reference

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 ()
 

Detailed Description

Provides procedures to parse the command line arguments, generating a list of tokens grouped as:

  • Configuration files
  • Input files
  • Output files

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.

Version 1

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>)*

Version 2

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.

Both

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

E2E_HOME

variable is made.

Constructor & Destructor Documentation

◆ CLP()

esa.opensf.osfi.CLP.CLP ( final String[]  args)

Parse the command line arguments into the configuration, input and output files.

Parameters
argsArguments array as passed to the
main
function.
Exceptions
IllegalArgumentExceptionif the arguments are invalid

References esa.opensf.osfi.CLP.parseFiles(), and esa.opensf.osfi.Logger.warning().

Member Function Documentation

◆ checkValidFile()

void esa.opensf.osfi.CLP.checkValidFile ( final String  file)

Checks the OS validity of a file name.

Parameters
filefile name to validate
Exceptions
IllegalArgumentExceptionin case of invalid file name.
Deprecated:
It validates a file according to CLI v1

◆ getConfFile()

String esa.opensf.osfi.CLP.getConfFile ( )

Gets the name of the configuration file. Configuration file can be "" is no configuration file is passed.

Deprecated:
Modules that do not support a global configuration file are deprecated

◆ getConfFiles()

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.

◆ getInputFiles()

List<String> esa.opensf.osfi.CLP.getInputFiles ( )

Gets the list of the input files.

◆ getOutputFiles()

List<String> esa.opensf.osfi.CLP.getOutputFiles ( )

Gets the list of the output files.

◆ parseFiles()

List<String> esa.opensf.osfi.CLP.parseFiles ( final String  arg)

Parses a string to obtain a list of tokenized strings, separated by a delimiter.

Exceptions
IllegalArgumentExceptionin case of invalid files.
Deprecated:
The method is not part of the external API. It only makes sense for CLI v1.

References esa.opensf.osfi.Logger.debug().


The documentation for this class was generated from the following file: