Nitido Inc.

com.nitido.util
Class LdapUtil

java.lang.Object
  extended by com.nitido.util.LdapUtil

public class LdapUtil
extends java.lang.Object

Utility class that provides utility methods that is specific to LDAP protocol. For example, escaping special characters in a Java string into the format used by LDAP for specifying the DN.


Field Summary
protected static char[] HEX_DIGIT_CONVERSION_ARRAY
           
 
Constructor Summary
LdapUtil()
           
 
Method Summary
static void appendByteInHex(java.lang.StringBuffer buf, byte inByte)
          Append the specified byte into the StringBuffer in the format of "\XX", where XX is the hexadecimal representation of the byte.
static void appendByteInHex(java.lang.StringBuilder buf, byte inByte)
          Append the specified byte into the StringBuilder in the format of "\XX", where XX is the hexadecimal representation of the byte.
static void appendCharInUTF8(java.lang.StringBuffer buf, char inChar)
          Append the specified character into the StringBuffer as a string of hexadecimal character representation in UTF 8 encoding.
static void appendCharInUTF8(java.lang.StringBuilder buf, char inChar)
          Append the specified character into the StringBuilder as a string of hexadecimal character representation in UTF 8 encoding.
static void appendHexDigit(java.lang.StringBuffer buf, byte inByte)
          Append the specified hexadecimal digit into the StringBuffer as a single character between 0 to F.
static void appendHexDigit(java.lang.StringBuilder buf, byte inByte)
          Append the specified hexadecimal digit into the StringBuilder as a single character between 0 to F.
static java.lang.String convertForDN(java.lang.String inStr)
          Convert a string into the DN format as specified in RFC 2253.
static java.lang.String convertForFilter(java.lang.String inStr)
          Convert the inStr into a string that can be used in a LDAP search filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HEX_DIGIT_CONVERSION_ARRAY

protected static final char[] HEX_DIGIT_CONVERSION_ARRAY
Constructor Detail

LdapUtil

public LdapUtil()
Method Detail

convertForDN

public static java.lang.String convertForDN(java.lang.String inStr)
Convert a string into the DN format as specified in RFC 2253.


convertForFilter

public static java.lang.String convertForFilter(java.lang.String inStr)
Convert the inStr into a string that can be used in a LDAP search filter. This method is usually used to convert the attribute value field of a filter condition into a string that can be used as a LDAP search filter.


appendByteInHex

public static void appendByteInHex(java.lang.StringBuilder buf,
                                   byte inByte)
Append the specified byte into the StringBuilder in the format of "\XX", where XX is the hexadecimal representation of the byte.


appendHexDigit

public static void appendHexDigit(java.lang.StringBuilder buf,
                                  byte inByte)
Append the specified hexadecimal digit into the StringBuilder as a single character between 0 to F. (i.e. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F)


appendCharInUTF8

public static void appendCharInUTF8(java.lang.StringBuilder buf,
                                    char inChar)
Append the specified character into the StringBuilder as a string of hexadecimal character representation in UTF 8 encoding. The converted string is usually used as part of the LDAP DN as specified in RFC 2253. The format of the converted character would take the format of "\XX\YY\ZZ...", where XX, YY, ZZ is the hexadecimal representation of the character.


appendByteInHex

public static void appendByteInHex(java.lang.StringBuffer buf,
                                   byte inByte)
Append the specified byte into the StringBuffer in the format of "\XX", where XX is the hexadecimal representation of the byte.


appendHexDigit

public static void appendHexDigit(java.lang.StringBuffer buf,
                                  byte inByte)
Append the specified hexadecimal digit into the StringBuffer as a single character between 0 to F. (i.e. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F)


appendCharInUTF8

public static void appendCharInUTF8(java.lang.StringBuffer buf,
                                    char inChar)
Append the specified character into the StringBuffer as a string of hexadecimal character representation in UTF 8 encoding. The converted string is usually used as part of the LDAP DN as specified in RFC 2253. The format of the converted character would take the format of "\XX\YY\ZZ...", where XX, YY, ZZ is the hexadecimal representation of the character.


Nitido NiM 2.5 Java API

These JavaDoc pages are generated for release/nim_2_5-2.5.44

Copyright © 1999-2009 Nitido Inc.    Proprietary and Confidential.    All Rights Reserved.