Search in sources :

Example 1 with ByteString

use of org.opends.server.types.ByteString in project midpoint by Evolveum.

the class OpenDJController method getAttributeValueBinary.

public static byte[] getAttributeValueBinary(Entry response, String name) {
    List<Attribute> attrs = response.getAttribute(name.toLowerCase());
    if (attrs == null || attrs.size() == 0) {
        return null;
    }
    assertEquals("Too many attributes for name " + name + ": ", 1, attrs.size());
    Attribute attribute = attrs.get(0);
    ByteString value = attribute.iterator().next().getValue();
    return value.toByteArray();
}
Also used : Attribute(org.opends.server.types.Attribute) ByteString(org.opends.server.types.ByteString)

Aggregations

Attribute (org.opends.server.types.Attribute)1 ByteString (org.opends.server.types.ByteString)1