Class LDIFParser

  • All Implemented Interfaces:
    ParserInterface, VersionInfoInterface

    public class LDIFParser
    extends ParserImpl
    The LDIF Parser reads and writes LDIF style data. The LDIF Parser is usually to do file exchange with an LDAP directory.
    • Constructor Detail

      • LDIFParser

        public LDIFParser()
        Creates LDIF Parser.
    • Method Detail

      • initParser

        public void initParser()
        This function is called after the connector has initialized the parser with input/output streams.
        Specified by:
        initParser in interface ParserInterface
        Overrides:
        initParser in class ParserImpl
      • readEntry

        public Entry readEntry()
                        throws java.io.IOException
        Reads LDIF files into entries. This method parses LDIF attributes to entry attributes and maps "dn" key to internal name specified by the ldifDNAttributeName parameter. This is the main entry point for reading entries.
        Returns:
        entry
        Throws:
        java.io.IOException - If an I/O error occurs
      • writeEntry

        public void writeEntry​(Entry entry)
                        throws java.io.IOException
        Writes entry in LDIF format to the current output writer. Depending on whether ldifVersion parameter is checked the ldif version number is also written .
        Parameters:
        entry - the entry to be written.
        Throws:
        java.io.IOException - If an I/O error occurs
      • getVersion

        public java.lang.String getVersion()
        Version information.
        Returns:
        version information
      • main

        public static void main​(java.lang.String[] argv)
        Provided to test/debug function usage: passed argument of classpath to LDIF file will dump entries.
        Parameters:
        argv - String array