/** * Convert an Entry to LDIF * * @param entry the Entry to convert * @return the corresponding LDIF code as a String */ public static String convertToLdif( Entry entry ) { return convertToLdif( entry, DEFAULT_LINE_LENGTH ); }
/** * Convert an LdifEntry to LDIF * * @param entry the LdifEntry to convert * @return the corresponding LDIF as a String * @throws LdapException If a naming exception is encountered. */ public static String convertToLdif( LdifEntry entry ) throws LdapException { return convertToLdif( entry, DEFAULT_LINE_LENGTH ); }
/** * Convert an Entry to LDIF * * @param entry the Entry to convert * @return the corresponding LDIF code as a String */ public static String convertToLdif( Entry entry ) { return convertToLdif( entry, DEFAULT_LINE_LENGTH ); }
/** * Convert an LdifEntry to LDIF * * @param entry the LdifEntry to convert * @return the corresponding LDIF as a String * @throws LdapException If a naming exception is encountered. */ public static String convertToLdif( LdifEntry entry ) throws LdapException { return convertToLdif( entry, DEFAULT_LINE_LENGTH ); }
/** * Converts an EntryAttribute to LDIF * * @param attr the EntryAttribute to convert * @return the corresponding LDIF code as a String */ public static String convertToLdif( Attribute attr ) { return convertToLdif( attr, DEFAULT_LINE_LENGTH ); }
/** * Converts an EntryAttribute to LDIF * * @param attr the EntryAttribute to convert * @return the corresponding LDIF code as a String */ public static String convertToLdif( Attribute attr ) { return convertToLdif( attr, DEFAULT_LINE_LENGTH ); }
/** * Convert an Entry to LDIF * * @param entry the Entry to convert * @return the corresponding LDIF code as a String */ public static String convertToLdif( Entry entry ) { return convertToLdif( entry, DEFAULT_LINE_LENGTH ); }
/** * Convert an LdifEntry to LDIF * * @param entry the LdifEntry to convert * @return the corresponding LDIF as a String * @throws LdapException If a naming exception is encountered. */ public static String convertToLdif( LdifEntry entry ) throws LdapException { return convertToLdif( entry, DEFAULT_LINE_LENGTH ); }
/** * Converts an EntryAttribute to LDIF * * @param attr the EntryAttribute to convert * @return the corresponding LDIF code as a String */ public static String convertToLdif( Attribute attr ) { return convertToLdif( attr, DEFAULT_LINE_LENGTH ); }
/** * @return a String representing the Entry, as a LDIF */ @Override public String toString() { try { return LdifUtils.convertToLdif( this ); } catch ( LdapException ne ) { return ""; } }
/** * @return a String representing the Entry, as a LDIF */ @Override public String toString() { try { return LdifUtils.convertToLdif( this ); } catch ( LdapException ne ) { return ""; } }
/** * Convert an Entry to LDIF including a version number at the top * * @param entry the Entry to convert * @param includeVersionInfo flag to tell whether to include version number or not * @return the corresponding LDIF code as a String */ public static String convertToLdif( Entry entry, boolean includeVersionInfo ) { String ldif = convertToLdif( entry, DEFAULT_LINE_LENGTH ); if ( includeVersionInfo ) { ldif = "version: 1" + LINE_SEPARATOR + ldif; } return ldif; }
/** * @return a String representing the Entry, as a LDIF */ @Override public String toString() { try { return LdifUtils.convertToLdif( this ); } catch ( LdapException ne ) { return ""; } }
/** * Convert an Attributes as LDIF. The Dn is written. * * @param attrs the Attributes to convert * @param dn The Dn for this entry * @return the corresponding LDIF code as a String * @throws LdapException If a naming exception is encountered. */ public static String convertToLdif( Attributes attrs, Dn dn ) throws LdapException { return convertToLdif( AttributeUtils.toEntry( attrs, dn ), DEFAULT_LINE_LENGTH ); }
/** * append data to the LDIF file * * @param entry the entry to be written * @throws LdapException */ private void appendLdif( Entry entry ) throws IOException, LdapException { synchronized ( lock ) { String ldif = LdifUtils.convertToLdif( entry ); ldifFile.write( Strings.getBytesUtf8( ldif + "\n" ) ); } }
/** * Convert an Attributes as LDIF. The Dn is written. * * @param attrs the Attributes to convert * @param dn The Dn for this entry * @return the corresponding LDIF code as a String * @throws LdapException If a naming exception is encountered. */ public static String convertToLdif( Attributes attrs, Dn dn ) throws LdapException { return convertToLdif( AttributeUtils.toEntry( attrs, dn ), DEFAULT_LINE_LENGTH ); }
/** * Convert an Attributes as LDIF. The Dn is written. * * @param attrs the Attributes to convert * @param dn The Dn for this entry * @return the corresponding LDIF code as a String * @throws LdapException If a naming exception is encountered. */ public static String convertToLdif( Attributes attrs, Dn dn ) throws LdapException { return convertToLdif( AttributeUtils.toEntry( attrs, dn ), DEFAULT_LINE_LENGTH ); }
/** * Convert an Attributes as LDIF. The Dn is written. * * @param attrs the Attributes to convert * @param dn The Dn for this entry * @param length The ldif line length * @return the corresponding LDIF code as a String * @throws LdapException If a naming exception is encountered. */ public static String convertToLdif( Attributes attrs, Dn dn, int length ) throws LdapException { return convertToLdif( AttributeUtils.toEntry( attrs, dn ), length ); }
/** * Convert an Attributes as LDIF. The Dn is written. * * @param attrs the Attributes to convert * @param dn The Dn for this entry * @param length The ldif line length * @return the corresponding LDIF code as a String * @throws LdapException If a naming exception is encountered. */ public static String convertToLdif( Attributes attrs, Dn dn, int length ) throws LdapException { return convertToLdif( AttributeUtils.toEntry( attrs, dn ), length ); }
/** * Convert an Attributes as LDIF. The Dn is written. * * @param attrs the Attributes to convert * @param dn The Dn for this entry * @param length The ldif line length * @return the corresponding LDIF code as a String * @throws LdapException If a naming exception is encountered. */ public static String convertToLdif( Attributes attrs, Dn dn, int length ) throws LdapException { return convertToLdif( AttributeUtils.toEntry( attrs, dn ), length ); }