sb.append( stripLineToNChars( lineBuffer.toString(), length ) );
/** * Convert an Entry as LDIF * * @param entry the Entry to convert * @param length the expected line length * @return the corresponding LDIF code as a String */ public static String convertToLdif( Entry entry, int length ) { StringBuilder sb = new StringBuilder(); if ( entry.getDn() != null ) { // First, dump the Dn if ( isLDIFSafe( entry.getDn().getName() ) ) { sb.append( stripLineToNChars( "dn: " + entry.getDn().getName(), length ) ); } else { sb.append( stripLineToNChars( "dn:: " + encodeBase64( entry.getDn().getName() ), length ) ); } sb.append( '\n' ); } // Then all the attributes for ( Attribute attribute : entry ) { sb.append( convertToLdif( attribute, length ) ); } return sb.toString(); }
/** * Convert an Entry as LDIF * * @param entry the Entry to convert * @param length the expected line length * @return the corresponding LDIF code as a String */ public static String convertToLdif( Entry entry, int length ) { StringBuilder sb = new StringBuilder(); if ( entry.getDn() != null ) { // First, dump the Dn if ( isLDIFSafe( entry.getDn().getName() ) ) { sb.append( stripLineToNChars( "dn: " + entry.getDn().getName(), length ) ); } else { sb.append( stripLineToNChars( "dn:: " + encodeBase64( entry.getDn().getName() ), length ) ); } sb.append( '\n' ); } // Then all the attributes for ( Attribute attribute : entry ) { sb.append( convertToLdif( attribute, length ) ); } return sb.toString(); }
sb.append( stripLineToNChars( lineBuffer.toString(), length ) );
sb.append( stripLineToNChars( lineBuffer.toString(), length ) );
/** * Convert an Entry as LDIF * * @param entry the Entry to convert * @param length the expected line length * @return the corresponding LDIF code as a String */ public static String convertToLdif( Entry entry, int length ) { StringBuilder sb = new StringBuilder(); if ( entry.getDn() != null ) { // First, dump the Dn if ( isLDIFSafe( entry.getDn().getName() ) ) { sb.append( stripLineToNChars( "dn: " + entry.getDn().getName(), length ) ); } else { sb.append( stripLineToNChars( "dn:: " + encodeBase64( entry.getDn().getName() ), length ) ); } sb.append( '\n' ); } // Then all the attributes for ( Attribute attribute : entry ) { sb.append( convertToLdif( attribute, length ) ); } return sb.toString(); }
sb.append( stripLineToNChars( "dn: " + entry.getDn(), length ) ); sb.append( stripLineToNChars( "dn:: " + encodeBase64( entry.getDn().getName() ), length ) ); sb.append( stripLineToNChars( controlStr.toString(), length ) ); sb.append( '\n' ); sb.append( stripLineToNChars( "changetype: " + changeType, length ) ); sb.append( '\n' ); if ( entry.hasControls() ) sb.append( stripLineToNChars( "changetype: " + ChangeType.Add, length ) );
sb.append( stripLineToNChars( "dn: " + entry.getDn(), length ) ); sb.append( stripLineToNChars( "dn:: " + encodeBase64( entry.getDn().getName() ), length ) ); sb.append( stripLineToNChars( controlStr.toString(), length ) ); sb.append( '\n' ); sb.append( stripLineToNChars( "changetype: " + changeType, length ) ); sb.append( '\n' ); if ( entry.hasControls() ) sb.append( stripLineToNChars( "changetype: " + ChangeType.Add, length ) );
sb.append( stripLineToNChars( "dn: " + entry.getDn(), length ) ); sb.append( stripLineToNChars( "dn:: " + encodeBase64( entry.getDn().getName() ), length ) ); sb.append( stripLineToNChars( controlStr.toString(), length ) ); sb.append( '\n' ); sb.append( stripLineToNChars( "changetype: " + changeType, length ) ); sb.append( '\n' ); if ( entry.hasControls() ) sb.append( stripLineToNChars( "changetype: " + ChangeType.Add, length ) );