>> I tried to hack it together with
> (FilterParser.parse(filter.toString()) but
>> this fails when my memberOf groupDN has parenthesis in it.
>
> Well, the parser might not be perfect :/ Worth a JIRA, IMO.
>
>
> Actually I like it how it is. The problem is that filter.toString() can
> produce things like (cn=bobs group(not jims)) which is the correct way
> to look at it as to string I think. But it cannot be parsed, because
> the parens would have to be escaped. I don't think they should be
> escaped in the toString function, that is why I did not enter a Jira
> ticket.
RFC 4515 says that string representations of a filter should escape
some chars. Your sample should be :
(cn=bobs group\28not jims\29)
filter = LPAREN filtercomp RPAREN
filtercomp = and / or / not / item
item = simple / present / substring / extensible
simple = attr filtertype assertionvalue
assertionvalue = valueencoding
valueencoding = 0*(normal / escaped)
normal = UTF1SUBSET / UTFMB
escaped = ESC HEX HEX
UTF1SUBSET = %x01-27 / %x2B-5B / %x5D-7F
; UTF1SUBSET excludes 0x00 (NUL), LPAREN,
; RPAREN, ASTERISK, and ESC.
So the filter might work well, but I think that a asString() method
should produce such a String with escaped parentheses. JIRA ?
--
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com