checkInputSuffix();
// WORK suffix (will rename in input directory)
_workingSuffix = ListenerUtil.getValue(config, ListenerTagNames.FILE_WORK_SFX_TAG, ".esbWork").trim();
if (_workingSuffix.length() < 1) {
throw new ConfigurationException("Invalid "+ ListenerTagNames.FILE_WORK_SFX_TAG + " attribute");
}
if (_inputSuffix.equals(_workingSuffix)) {
throw new ConfigurationException("Work suffix must differ from input suffix <" + _workingSuffix + ">");
}
// ERROR directory and suffix (defaults to input dir and
// ".esbError"
// suffix)
String sErrDir = ListenerUtil.getValue(config, ListenerTagNames.FILE_ERROR_DIR_TAG, sInpDir);
_errorDirectory = fileFromString(sErrDir);
seeIfOkToWorkOnDir(_errorDirectory);
_errorSuffix = ListenerUtil.getValue(config, ListenerTagNames.FILE_ERROR_SFX_TAG, ".esbError").trim();
if (_errorSuffix.length() < 1) {
throw new ConfigurationException("Invalid " + ListenerTagNames.FILE_ERROR_SFX_TAG + " attribute");
}
if (_errorDirectory.equals(_inputDirectory) && _inputSuffix.equals(_errorSuffix)) {
throw new ConfigurationException("Error suffix must differ from input suffix <" + _errorSuffix + ">");
}
// Do users wish to delete files that were processed OK ?
String sPostDel = ListenerUtil.getValue(config, ListenerTagNames.FILE_POST_DEL_TAG, "false").trim();
_deleteAfterOK = Boolean.parseBoolean(sPostDel);
if (_deleteAfterOK) {
return;
}
// Do users wish to rename files that were processed OK ?
String sPostRename = ListenerUtil.getValue(config, ListenerTagNames.FILE_POST_RENAME_TAG, "true").trim();
_renameAfterOK = Boolean.parseBoolean(sPostRename);
// POST (done) directory and suffix (defaults to input dir and
// ".esbDone" suffix)
String sPostDir = ListenerUtil.getValue(config, ListenerTagNames.FILE_POST_DIR_TAG, sInpDir);
_postProcessDirectory = fileFromString(sPostDir);
seeIfOkToWorkOnDir(_postProcessDirectory);
_postProcessSuffix = ListenerUtil.getValue(config, ListenerTagNames.FILE_POST_SFX_TAG, ".esbDone").trim();
if (_postProcessDirectory.equals(_inputDirectory)) {
if (_postProcessSuffix.length() < 1) {
throw new ConfigurationException("Invalid " + ListenerTagNames.FILE_POST_SFX_TAG + " attribute");
}
if (_postProcessSuffix.equals(_inputSuffix)) {
throw new ConfigurationException("Post process suffix must differ from input suffix <" + _postProcessSuffix + ">");
}
}
}