Class LdifReader

    • Field Detail

      • READ_AHEAD_LIMIT

        private static final int READ_AHEAD_LIMIT
        Mark read back buffer size.
        See Also:
        Constant Field Values
      • logger

        protected final Logger logger
        Logger for this class.
      • ldifReader

        private final Reader ldifReader
        Reader to read from.
    • Constructor Detail

      • LdifReader

        public LdifReader​(Reader reader)
        Creates a new ldif reader.
        Parameters:
        reader - to read LDIF from
    • Method Detail

      • readSection

        private List<String> readSection​(BufferedReader reader)
                                  throws IOException
        Reads the supplied reader line-by-line until the reader is empty or a empty line is encountered. Lines containing comments are ignored.
        Parameters:
        reader - to read
        Returns:
        list of a lines in the section
        Throws:
        IOException - if an error occurs reading
      • parseEntry

        private LdapEntry parseEntry​(List<String> section)
                              throws IOException
        Parses the supplied array of LDIF lines and returns an LDAP entry.
        Parameters:
        section - of LDIF lines
        Returns:
        ldap entry
        Throws:
        IOException - if an errors occurs reading a URI in the LDIF
      • parseAttribute

        private LdapAttribute parseAttribute​(String line)
                                      throws IOException
        Parses the supplied line and returns an attribute with a single value found in the line.
        Parameters:
        line - to parse
        Returns:
        ldap attribute
        Throws:
        IOException - if an errors occurs reading a URI in the LDIF
      • parseReference

        private SearchResultReference parseReference​(List<String> section)
        Parses the supplied array of LDIF lines and returns a search reference.
        Parameters:
        section - of LDIF lines
        Returns:
        search reference