Class LdapUtils


  • public final class LdapUtils
    extends Object
    Utility class providing static methods to make working with LDAP easier.
    Since:
    0.2
    • Constructor Detail

      • LdapUtils

        public LdapUtils()
    • Method Detail

      • closeContext

        public static void closeContext(LdapContext ctx)
        Closes an LDAP context, logging any errors, but not throwing an exception if there is a failure.
        Parameters:
        ctx - the LDAP context to close.
      • getAllAttributeValues

        public static Collection<String> getAllAttributeValues(Attribute attr)
                                                        throws NamingException
        Helper method used to retrieve all attribute values from a particular context attribute.
        Parameters:
        attr - the LDAP attribute.
        Returns:
        the values of the attribute.
        Throws:
        NamingException - if there is an LDAP error while reading the values.