Search in sources :

Example 6 with IDNType

use of com.zimbra.cs.account.AttributeManager.IDNType in project zm-mailbox by Zimbra.

the class Entry method getUnicodeMultiAttr.

/**
     * Returns the set of values for the given attribute, or an empty
     * array if no values are defined.
     */
public String[] getUnicodeMultiAttr(String name) {
    String[] values = getMultiAttr(name, true);
    AttributeManager attrMgr = getAttributeManager();
    IDNType idnType = AttributeManager.idnType(attrMgr, name);
    if (idnType.isEmailOrIDN() && values != null) {
        String[] unicodeValues = new String[values.length];
        for (int i = 0; i < values.length; i++) unicodeValues[i] = IDNUtil.toUnicode(values[i], idnType);
        return unicodeValues;
    } else
        return values;
}
Also used : IDNType(com.zimbra.cs.account.AttributeManager.IDNType)

Aggregations

IDNType (com.zimbra.cs.account.AttributeManager.IDNType)6 ServiceException (com.zimbra.common.service.ServiceException)3 AttributeManager (com.zimbra.cs.account.AttributeManager)3 HashSet (java.util.HashSet)2 Iterator (java.util.Iterator)2 Map (java.util.Map)2 Entry (java.util.Map.Entry)2 ToZJSONObject (com.zimbra.client.ToZJSONObject)1 ZJSONObject (com.zimbra.client.ZJSONObject)1