LoadFilePreparser
Configuration file |
load_file.properties |
Class name |
com.ebd.hub.datawizard.parser.LoadFilePreparser |
Description
This preparser loads an external file and replaces the original input file. It is mandatory to define a regular expression in the configuration file, that is used to define the original file name, to determine the name of the replacement file.
Parameters
Parameter |
Description |
loadfile.filename.srcregex |
(mandatory) The regular expression to be performed on the original filename. If it is missing, the preparser will fail with an error message. |
loadfile.filenameregex.usegroup |
The group number (zero indexed) to be used. (bla)(blub) will return bla, if group is set to 0, and will return blub if group is set to 1. If not specified, 0 will be used by default. |
loadfile.filename.insertstring |
The rule to build the filename to look for. The string ${src} will be replaced by the result of the regular expression matching. If not specified, ${src} will be used by default. |
backupfile.extension |
The extension of the loaded file, when it is saved to the backup directory together with the originally loaded and the environment file. If not set, .ext will be used. |
loadfile.deletefile |
If set to false, the loaded file will not be deleted after being saved to the backup directory. If not set, true will be used by default. |
loadfile.deletefailure.iserror |
If the loaded file cannot be deleted, an error will be thrown, if set to true. If not set, false is used by default. |
loadfile.nonexist.iserror |
If set to true, an error will be thrown, if the file to be loaded cannot be found. If set to false, empty data will be passed to the mapping. If not set, true will be used by default. |
Note: To define the file name explicitly, it has to be written between \Q and \E.
Note: You have to place an escape character \ in front of the character \, the character sequence :=, and a whitespace. So, for example, \\ or \:=.
Example file
loadfile.filename.srcregex=([^\.]+)\.txt
Cuts off ".txt".