List of usage examples for com.liferay.portal.kernel.util StringUtil removeFromList
public static String removeFromList(String s, String element)
remove string from string s that represents a list of comma delimited strings. From source file:com.liferay.journal.util.impl.JournalUtil.java
License:Open Source License
public static String removeArticleLocale(Document document, String content, String languageId) { try {// ww w .j a va 2s. c om Element rootElement = document.getRootElement(); String availableLocales = rootElement.attributeValue("available-locales"); if (availableLocales == null) { return content; } availableLocales = StringUtil.removeFromList(availableLocales, languageId); if (availableLocales.endsWith(",")) { availableLocales = availableLocales.substring(0, availableLocales.length() - 1); } rootElement.addAttribute("available-locales", availableLocales); removeArticleLocale(rootElement, languageId); content = XMLUtil.formatXML(document); } catch (Exception e) { _log.error(e, e); } return content; }