/** * Converts an EntryAttribute to LDIF * @param attr the >EntryAttribute to convert * @return the corresponding LDIF code as a String * @throws LdapException If a naming exception is encountered. */ public static String convertToLdif( EntryAttribute attr ) throws LdapException { return convertToLdif( attr, 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 ); }
/** * @return a String representing the Entry, as a LDIF */ public String toString() { try { return LdifUtils.convertToLdif( this ); } catch ( LdapException ne ) { return null; } }
/** * Convert the Entry's attributes to LDIF. The DN is not written. * @param entry the Entry to convert * @param length the expected line length * @return the corresponding LDIF code as a String * @throws LdapException If a naming exception is encountered. */ public static String convertAttributesToLdif( Entry entry, int length ) throws LdapException { StringBuilder sb = new StringBuilder(); // Then all the attributes for ( EntryAttribute attribute:entry ) { sb.append( convertToLdif( attribute, length ) ); } return sb.toString(); }
sb.append( convertToLdif( attribute, length ) );
sb.append( convertToLdif( attribute, length ) ); sb.append( convertToLdif( newRdn, length ) ); sb.append( convertToLdif( newSuperior, length ) ); sb.append( '\n' ); sb.append( convertToLdif( modification.getAttribute() ) ); sb.append( "-\n" );