public class LDAPStringUtil extends Object
| Constructor and Description |
|---|
LDAPStringUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
encodeForFilter(String filterString)
Encode a string so that it can be used in an LDAP search filter.
|
public static String encodeForFilter(String filterString)
Encode a string so that it can be used in an LDAP search filter.
The following table shows the characters that are encoded and their encoded version.
| Character | Encoded As |
|---|---|
| * | \2a |
| ( | \28 |
| ) | \29 |
| \ | \5c |
null | \00 |
In addition to encoding the above characters, any non-ASCII character
(any character with a hex value greater then 0x7f) is also
encoded and rewritten as a UTF-8 character or sequence of characters in
hex notation.
filterString - a string that is to be encodedfilterString suitable for use
in a LDAP search filterCopyright © 2008-2014 Red Hat, Inc.. All Rights Reserved.