/** * Change templates using given database template * * @param dbTemplate new database template * @since 5.4.2 */ public void changeDBTemplate(String dbTemplate) { changeTemplates(rebuildTemplatesStr(dbTemplate)); }
/** * Add template(s) to the {@link #PARAM_TEMPLATES_NAME} list if not already present * * @param templatesToAdd Comma separated templates to add * @since 5.5 */ public void addTemplate(String templatesToAdd) throws ConfigurationException { List<String> templatesList = getTemplateList(); List<String> templatesToAddList = asList(templatesToAdd.split(TEMPLATE_SEPARATOR)); if (templatesList.addAll(templatesToAddList)) { String newTemplatesStr = String.join(TEMPLATE_SEPARATOR, templatesList); HashMap<String, String> parametersToSave = new HashMap<>(); parametersToSave.put(PARAM_TEMPLATES_NAME, newTemplatesStr); saveFilteredConfiguration(parametersToSave); changeTemplates(newTemplatesStr); } }
/** * Remove template(s) from the {@link #PARAM_TEMPLATES_NAME} list * * @param templatesToRm Comma separated templates to remove * @since 5.5 */ public void rmTemplate(String templatesToRm) throws ConfigurationException { List<String> templatesList = getTemplateList(); List<String> templatesToRmList = asList(templatesToRm.split(TEMPLATE_SEPARATOR)); if (templatesList.removeAll(templatesToRmList)) { String newTemplatesStr = String.join(TEMPLATE_SEPARATOR, templatesList); Map<String, String> parametersToSave = new HashMap<>(); parametersToSave.put(PARAM_TEMPLATES_NAME, newTemplatesStr); saveFilteredConfiguration(parametersToSave); changeTemplates(newTemplatesStr); } }