return resourceName;
}
protected void updateCrontab(String crontabPath, ConfigurationDefinition crontabConfigurationDefinition,
Configuration crontabConfiguration) {
Augeas augeas = null;
try {
augeas = getAugeas();
File crontabFile = new File(crontabPath);
String basePath = AUGEAS_FILES_PREFIX + crontabFile.getAbsolutePath();
AugeasNode baseNode = new AugeasNode(basePath);
PropertyList entries = crontabConfiguration.getList(CronTabComponent.ENTRIES_PROP);
PropertyDefinitionList entriesDef = crontabConfigurationDefinition
.getPropertyDefinitionList(CronTabComponent.ENTRIES_PROP);
setNodeFromPropertyList(entriesDef, entries, augeas, baseNode);
PropertyList settings = crontabConfiguration.getList(CronTabComponent.ENVIRONMENT_SETTINGS_PROP);
if (settings != null) {
for (Property p : settings.getList()) {
PropertyMap setting = (PropertyMap) p;
String name = setting.getSimpleValue(CronTabComponent.NAME_PROP, null);
String value = setting.getSimpleValue(CronTabComponent.VALUE_PROP, "");
if (name != null) {
String settingPath = basePath + AugeasNode.SEPARATOR + name;
augeas.set(settingPath, value);
}
}
}
augeas.save();
} catch (AugeasException e) {
if (augeas != null)
throw new RuntimeException(summarizeAugeasError(augeas), e);
else
throw new RuntimeException(e);