* @param projectOperations
*/
public static void updatePlugins(String pluginConfiguration,
ProjectOperations projectOperations) {
Configuration conf = null;
// Generating configuration if necessary
if (StringUtils.isNotBlank(pluginConfiguration)) {
try {
DocumentBuilderFactory docFactory = DocumentBuilderFactory
.newInstance();
DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
Document doc = docBuilder.newDocument();
Element configElement = doc.createElement("configuration");
// Getting all configurations
String[] configurationTags = pluginConfiguration.split(",");
for (String configurationTag : configurationTags) {
String[] keyValue = configurationTag.split("=");
if (keyValue.length == 2) {
Element element = doc.createElement(keyValue[0]);
element.setTextContent(keyValue[1]);
configElement.appendChild(element);
}
}
conf = new Configuration(configElement);
} catch (Exception e) {
LOGGER.log(Level.WARNING, "[ERROR] " + e);
}
}