Search code examples
javaspringldapspring-ldapldif

How do I get LdapAttributes


I'm trying to export ActiveDirectory records into LDIF-formatted files using Spring.

I'm finding lots of information about parsing LDIF files, but relatively little about exporting to LDIF. With Spring there is an LdapAttributes class whose toString() method returns a string in LDIF format, but I don't see where to get the LdapAttributes instance in the first place. I don't see anything on the LdapTemplate.

Hopefully the framework provides a simple way to get this, rather than my having to build the LdapAttributes object myself.


Solution

  • Check out something like the unboundid LDAP SDK https://www.unboundid.com/products/ldap-sdk/docs/javadoc/com/unboundid/ldif/package-summary.html