Class LdifWriter

    • Field Detail

      • NUL_CHAR

        private static final int NUL_CHAR
        ASCII decimal value of nul.
        See Also:
        Constant Field Values
      • LF_CHAR

        private static final int LF_CHAR
        ASCII decimal value of line feed.
        See Also:
        Constant Field Values
      • CR_CHAR

        private static final int CR_CHAR
        ASCII decimal value of carriage return.
        See Also:
        Constant Field Values
      • SP_CHAR

        private static final int SP_CHAR
        ASCII decimal value of space.
        See Also:
        Constant Field Values
      • COLON_CHAR

        private static final int COLON_CHAR
        ASCII decimal value of colon.
        See Also:
        Constant Field Values
      • LA_CHAR

        private static final int LA_CHAR
        ASCII decimal value of left arrow.
        See Also:
        Constant Field Values
      • MAX_ASCII_CHAR

        private static final int MAX_ASCII_CHAR
        ASCII decimal value of highest character.
        See Also:
        Constant Field Values
      • LINE_SEPARATOR

        private static final String LINE_SEPARATOR
        Line separator.
      • ldifWriter

        private final Writer ldifWriter
        Writer to write to.
    • Constructor Detail

      • LdifWriter

        public LdifWriter​(Writer writer)
        Creates a new ldif writer.
        Parameters:
        writer - to write LDIF to
    • Method Detail

      • createLdif

        protected String createLdif​(SearchResult result)
        Creates an LDIF using the supplied search result.
        Parameters:
        result - search result
        Returns:
        LDIF
      • createLdifEntry

        protected String createLdifEntry​(LdapEntry entry)
        Creates an LDIF using the supplied ldap entry.
        Parameters:
        entry - ldap entry
        Returns:
        LDIF
      • createSearchReference

        protected String createSearchReference​(SearchReference ref)
        Creates an LDIF using the supplied search reference.
        Parameters:
        ref - search reference
        Returns:
        LDIF
      • encodeData

        private boolean encodeData​(String data)
        Determines whether the supplied data should be base64 encoded. See http://www.faqs.org/rfcs/rfc2849.html for more details.
        Parameters:
        data - to inspect
        Returns:
        whether the data should be base64 encoded