protected void mergeTemplates(AggregateConf instanceConf,
String internalTemplate,
String resourceTemplate,
String appConfTemplate) throws IOException {
if (internalTemplate != null) {
ConfTreeOperations template =
ConfTreeOperations.fromResource(internalTemplate);
instanceConf.getInternalOperations()
.mergeWithoutOverwrite(template.confTree);
}
if (resourceTemplate != null) {
ConfTreeOperations resTemplate =
ConfTreeOperations.fromResource(resourceTemplate);
instanceConf.getResourceOperations()
.mergeWithoutOverwrite(resTemplate.confTree);
}
if (appConfTemplate != null) {
ConfTreeOperations template =
ConfTreeOperations.fromResource(appConfTemplate);
instanceConf.getAppConfOperations()
.mergeWithoutOverwrite(template.confTree);
}