org.rhq.enterprise.server.resource.group
Class LDAPStringUtil

java.lang.Object
  extended by org.rhq.enterprise.server.resource.group.LDAPStringUtil

public class LDAPStringUtil
extends Object

A utility class containing static methods to perform common string manipulations or modifications for use with an LDAP implementation.

Since:
4.0.1
Author:
loleary

Constructor Summary
LDAPStringUtil()
           
 
Method Summary
static String encodeForFilter(String filterString)
          Encode a string so that it can be used in an LDAP search filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LDAPStringUtil

public LDAPStringUtil()
Method Detail

encodeForFilter

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.

CharacterEncoded 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.

Parameters:
filterString - a string that is to be encoded
Returns:
the encoded version of filterString suitable for use in a LDAP search filter
See Also:
RFC 4515


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.