directory-api mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lécharny <>
Subject Re: Binary value conversion for LDIF filters
Date Mon, 24 Feb 2014 17:55:30 GMT
Le 2/24/14 6:20 PM, Raphaël Ouazana-Sustowski a écrit :
> Hi,
> I have a binary attribute (a byte[] or a BinaryValue if needed). I'd
> like to convert it to an escaped format, suitable for a filter.
> Is there any convenient method to do this?

Create a Value (in your case, a BinaryValue) and use the ExprNode class
you need to create a filter (EqualityNode, SubstringNode, ...).

For instance,

Value<byte[]> binValue = new BinaryValue( <your byte[]> );
Node filter = new EqualityNode( "MyBinaryAttr", binValue );

String escapedString = filter.toString();

the escapedString should be fine as a filter.

Emmanuel Lécharny 

View raw message