public final class LdapUtils extends Object
Modifier and Type | Method and Description |
---|---|
static void |
closeContext(Context ctx) |
static String |
getRelativeName(String fullDn,
Context baseCtx)
Obtains the part of a DN relative to a supplied base context.
|
static byte[] |
getUtf8Bytes(String s) |
static String |
parseRootDnFromUrl(String url)
Works out the root DN for an LDAP URL.
|
public static void closeContext(Context ctx)
public static String getRelativeName(String fullDn, Context baseCtx) throws NamingException
If the DN is "cn=bob,ou=people,dc=acegisecurity,dc=org" and the base context name is "ou=people,dc=acegisecurity,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 byte[] getUtf8Bytes(String s)
Copyright © 2019. All rights reserved.