public final class LdapUtils extends Object
Modifier and Type | Method and Description |
---|---|
static void |
closeContext(Context ctx) |
static void |
closeEnumeration(NamingEnumeration ne) |
static String |
convertPasswordToString(Object passObj) |
static DistinguishedName |
getFullDn(DistinguishedName dn,
Context baseCtx)
Gets the full dn of a name by prepending the name of the context it is relative to.
|
static String |
getRelativeName(String fullDn,
Context baseCtx)
Obtains the part of a DN relative to a supplied base context.
|
static String |
parseRootDnFromUrl(String url)
Works out the root DN for an LDAP URL.
|
public static void closeContext(Context ctx)
public static void closeEnumeration(NamingEnumeration ne)
public static String getRelativeName(String fullDn, Context baseCtx) throws NamingException
If the DN is "cn=bob,ou=people,dc=springframework,dc=org" and the base context name is "ou=people,dc=springframework,dc=org" it would return "cn=bob".
fullDn
- the DNbaseCtx
- the context to work out the name relative to.NamingException
- any exceptions thrown by the context are propagated.public static DistinguishedName getFullDn(DistinguishedName dn, Context baseCtx) throws NamingException
NamingException