org.acegisecurity.ldap
public final class LdapUtils extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
closeContext(javax.naming.Context ctx) |
static java.lang.String |
getRelativeName(java.lang.String fullDn,
javax.naming.Context baseCtx)
Obtains the part of a DN relative to a supplied base context.
|
static byte[] |
getUtf8Bytes(java.lang.String s) |
static java.lang.String |
parseRootDnFromUrl(java.lang.String url)
Works out the root DN for an LDAP URL.
|
public static void closeContext(javax.naming.Context ctx)
public static java.lang.String getRelativeName(java.lang.String fullDn, javax.naming.Context baseCtx) throws javax.naming.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.javax.naming.NamingException
- any exceptions thrown by the context are propagated.public static byte[] getUtf8Bytes(java.lang.String s)
public static java.lang.String parseRootDnFromUrl(java.lang.String url)
For example, the URL ldap://monkeymachine:11389/dc=acegisecurity,dc=org has the root DN "dc=acegisecurity,dc=org".
url
- the LDAP URLCopyright © 2004-2014 Interface21, Inc. All Rights Reserved.