Class LdapUtils

java.lang.Object
org.apache.shiro.realm.ldap.LdapUtils

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

    • 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

      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.
    • closeEnumeration

      public static void closeEnumeration(NamingEnumeration ne)
      added based on SHIRO-127, per Emmanuel's comment [1] [1] invalid input: '<'a href="https://issues.apache.org/jira/browse/SHIRO-127?focusedCommentId=12891380invalid input: '&'" + "page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12891380" />