* @throws MojoExecutionException If an error occurred generating the output file content.
*/
private void dump(final LDAPConnection connection, final LDAPWriter writer)
throws MojoExecutionException {
try {
final LDAPSearchResults results = connection.search(
this.searchBase, LDAPv2.SCOPE_SUB, this.searchFilter, null,
false);
while (results.hasMoreElements()) {
final LDAPEntry entry = results.next();
this.getLog().info("Dumping: " + entry.getDN());
writer.printEntry(entry);
}
} catch (LDAPException e) {
final String message = "Error communicating with the LDAP directory";