// objConf = new SOSConfiguration(settings.Value(), profile.Value(), null);
if (objConf.getParameterAsProperties().size() <= 0) {
String strM = String.format(objMsg.getMsg(SOSVfs_E_0060), profile.Value(), settings.Value());
// String strM = String.format("SOSVfs-E-0000: Profile '%1$s' not found or is empty in file '%2$s'", profile.Value(),
// settings.Value());
logger.error(strM, new JobSchedulerException(strM));
throw new JobSchedulerException(strM);
}
Properties objP = new Properties();
objP.putAll(objGlobals);
objP.putAll(objConf.getParameterAsProperties());
while (true) {
Properties objIncludes = new Properties();
boolean flgIncludeFound = false;
for (Object k : objP.keySet()) {
String strKey = (String) k;
String strValue = (String) objP.get(k);
logger.debug("ReadSettingsFile() - Property. Key = " + strKey + ", val = " + strValue); //$NON-NLS-1$ //$NON-NLS-2$
if (isIncludeDirective(strKey)) {
String[] strValues = strValue.split(",");
for (String strV : strValues) {
SOSConfiguration config_ = new SOSConfiguration(settings.Value(), strV, objSOSLogger);
if (config_.getParameterAsProperties().size() <= 0) {
// String strM = String.format("SOSVfs-E-0000: Include '%1$s' not found or is empty in file '%2$s'", strV,
// settings.Value());
String strM = String.format(objMsg.getMsg(SOSVfs_E_0000), strV, settings.Value());
logger.error(strM);
throw new JobSchedulerException(strM);
}
objIncludes.putAll(config_.getParameterAsProperties());
}
flgIncludeFound = true;
}
else {
if (isIniComment(strKey) == false) {
// TODO check duplicate Entry but take into account, that includes are in effect
objIncludes.put(strKey, strValue);
}
}
} // for
if (objIncludes.size() > 0 && flgIncludeFound == true) {
objP = new Properties();
objP.putAll(objIncludes);
}
else {
break;
}
}
HashMap<String, String> map = new HashMap<String, String>();
for (Object k : objP.keySet()) {
String strKey = (String) k;
String strValue = (String) objP.get(k);
if (hasVariableToSubstiture(strValue) == true) {
logger.debug("ReadSettingsFile() - Key = " + strKey + ", value = " + strValue); //$NON-NLS-1$ //$NON-NLS-2$
strValue = SubstituteVariables(strValue, objP, "${", "}");
strValue = SubstituteVariables(strValue, objP, "%{", "}");
strValue = SubstituteVariables(strValue, objP, "%", "%");
strValue = SubstituteVariables(strValue, propSOSFtpEnvironmentVars, "${", "}");
strValue = SubstituteVariables(strValue, propSOSFtpEnvironmentVars, "%{", "}");
strValue = SubstituteVariables(strValue, propSOSFtpEnvironmentVars, "%", "%");
strValue = SubstituteVariables(strValue, propAllEnvironmentVariables, "${", "}");
strValue = SubstituteVariables(strValue, propAllEnvironmentVariables, "%{", "}");
strValue = SubstituteVariables(strValue, propAllEnvironmentVariables, "%", "%");
// TODO wrong place: has to come from the JS-Adapter as properties
strValue = SubstituteVariables(strValue, schedulerParams, "${", "}");
strValue = SubstituteVariables(strValue, schedulerParams, "%{", "}");
strValue = SubstituteVariables(strValue, schedulerParams, "%", "%");
if (hasVariableToSubstiture(strValue)) {
String strM = String.format(objMsg.getMsg(SOSVfs_W_0070), strValue, strKey);
logger.warn(strM);
}
}
map.put(strKey, strValue);
}
this.setAllOptions(map);
setChildClasses(map);
}
catch (Exception e) {
e.printStackTrace();
logger.error("ReadSettingsFile()", e); //$NON-NLS-1$
throw new JobSchedulerException(e.getMessage(), e);
}
} // private void ReadSettingsFile