use of org.apache.jsieve.parser.generated.TokenMgrError in project zm-mailbox by Zimbra.
the class RuleManager method getAdminRulesAsXML.
public static List<FilterRule> getAdminRulesAsXML(Entry entry, FilterType filterType, AdminFilterType afType) throws ServiceException {
Node node;
try {
node = getRulesNode(entry, filterType, afType);
} catch (ParseException | TokenMgrError e) {
throw ServiceException.PARSE_ERROR("parsing Sieve script", e);
}
String sieveScriptAttrName = getAdminScriptAttributeName(filterType, afType);
SieveToSoap sieveToSoap = new SieveToSoap(getRuleNames(entry.getAttr(sieveScriptAttrName)));
sieveToSoap.accept(node);
return sieveToSoap.toFilterRules();
}
Aggregations