format-api/src/main/java/com/btmatthews/maven/plugins/ldap/AbstractFormatHandler.java
public final void load(final LDAPInterface connection,
                           final InputStream inputStream,
                           final boolean ignoreErrors,
                           final FormatLogger logger) {
        final FormatReader reader = openReader(inputStream, logger);
        if (reader != null) {
            try {
                boolean keepReading = true;
                do {
                    try {
                        final LDIFChangeRecord record = reader.nextRecord();
                        if (record == null) {
                            keepReading = false;
                        } else {
                            record.processChange(connection);
                        }
                    } catch (final LDIFException e) {
                        if (!ignoreErrors || !e.mayContinueReading()) {
                            logger.logError("Error parsing directory entry read from the input stream", e);
                            keepReading = false;
                        }
                    } catch (final LDAPException e) {
                        if (!ignoreErrors) {
                            logger.logError("Error loading directory entry into the LDAP directory server", e);
                            keepReading = false;
                        }
                    }
                } while (keepReading);
            } catch (final IOException e) {
                logger.logError("I/O error reading directory entry from input stream", e);
            } finally {
                try {
                    reader.close();
                } catch (final IOException e) {
                    logger.logError("I/O error closing the input stream reader", e);
                }
            }
        }
    }
public final void load(final LDAPInterface connection,
                           final InputStream inputStream,
                           final boolean ignoreErrors,
                           final FormatLogger logger) {
        final FormatReader reader = openReader(inputStream, logger);
        if (reader != null) {
            try {
                boolean keepReading = true;
                do {
                    try {
                        final LDIFChangeRecord record = reader.nextRecord();
                        if (record == null) {
                            keepReading = false;
                        } else {
                            record.processChange(connection);
                        }
                    } catch (final LDIFException e) {
                        if (!ignoreErrors || !e.mayContinueReading()) {
                            logger.logError("Error parsing directory entry read from the input stream", e);
                            keepReading = false;
                        }
                    } catch (final LDAPException e) {
                        if (!ignoreErrors) {
                            logger.logError("Error loading directory entry into the LDAP directory server", e);
                            keepReading = false;
                        }
                    }
                } while (keepReading);
            } catch (final IOException e) {
                logger.logError("I/O error reading directory entry from input stream", e);
            } finally {
                try {
                    reader.close();
                } catch (final IOException e) {
                    logger.logError("I/O error closing the input stream reader", e);
                }
            }
        }
    }
Reads directory entries from the input stream and loads them in the LDAP directory server.

@param connection   The connection to the LDAP directory server.
@param inputStream  The input stream from which directory entries will be read.
@param ignoreErrors If {@code true} then loading will continue if an error occurs.
@param logger       Used to log information or error messages.