/** * Appends an LDIF representation of this entry to the provided buffer. Long * lines will not be wrapped. * * @param buffer The buffer to which the LDIF representation of this entry * should be written. */ public final void toLDIF(final ByteStringBuffer buffer) { toLDIF(buffer, 0); }
/** * Retrieves an LDIF representation of this entry, with each attribute value * on a separate line. Long lines will not be wrapped. * * @return An LDIF representation of this entry. */ public final String[] toLDIF() { return toLDIF(0); }
/** * Appends an LDIF representation of this entry to the provided buffer. Long * lines will not be wrapped. * * @param buffer The buffer to which the LDIF representation of this entry * should be written. */ public final void toLDIF(final ByteStringBuffer buffer) { toLDIF(buffer, 0); }
/** * Retrieves an LDIF representation of this entry, with each attribute value * on a separate line. Long lines will not be wrapped. * * @return An LDIF representation of this entry. */ public final String[] toLDIF() { return toLDIF(0); }
/** * Appends an LDIF representation of this entry to the provided buffer. * * @param buffer The buffer to which the LDIF representation of this * entry should be written. * @param wrapColumn The column at which long lines should be wrapped. A * value less than or equal to two indicates that no * wrapping should be performed. */ public void toLDIF(final ByteStringBuffer buffer, final int wrapColumn) { toEntry().toLDIF(buffer, wrapColumn); }
/** * Appends an LDIF representation of this entry to the provided buffer. * * @param buffer The buffer to which the LDIF representation of this * entry should be written. * @param wrapColumn The column at which long lines should be wrapped. A * value less than or equal to two indicates that no * wrapping should be performed. */ public void toLDIF(final ByteStringBuffer buffer, final int wrapColumn) { toEntry().toLDIF(buffer, wrapColumn); }
/** * Retrieves an LDIF representation of this entry, with each attribute value * on a separate line. Long lines will be wrapped at the specified column. * * @param wrapColumn The column at which long lines should be wrapped. A * value less than or equal to two indicates that no * wrapping should be performed. * * @return An LDIF representation of this entry. */ public String[] toLDIF(final int wrapColumn) { return toEntry().toLDIF(wrapColumn); }
/** * Retrieves an LDIF representation of this entry, with each attribute value * on a separate line. Long lines will be wrapped at the specified column. * * @param wrapColumn The column at which long lines should be wrapped. A * value less than or equal to two indicates that no * wrapping should be performed. * * @return An LDIF representation of this entry. */ public String[] toLDIF(final int wrapColumn) { return toEntry().toLDIF(wrapColumn); }
/** * Write the LDAP entry to the underlying output stream in LDIF format. * * @param entry The directory entry. * @throws IOException If there was a problem writing to the underlying output stream. */ public void printEntry(final Entry entry) throws IOException { if (entry != null) { final ByteStringBuffer buffer = new ByteStringBuffer(); entry.toLDIF(buffer, 77); if (!first) { ldifOutputStream.write(eol); } else { first = false; } ldifOutputStream.write(buffer.toByteArray()); } }
/** * {@inheritDoc} */ public ObjectPair<SearchResultEntryProtocolOp,Control[]> transformEntry( final int messageID, final SearchResultEntryProtocolOp entry, final Control[] controls) { final StringBuilder b = getBuffer(); appendHeader(b, messageID); b.append(" Search Result Entry Protocol Op:").append(EOL); final Entry e = new Entry(entry.getDN(), entry.getAttributes()); final String[] ldifLines = e.toLDIF(80); for (final String line : ldifLines) { b.append(" ").append(line).append(EOL); } appendControls(b, controls); logHandler.publish(new LogRecord(Level.INFO, b.toString())); return new ObjectPair<SearchResultEntryProtocolOp,Control[]>(entry, controls); }
/** * {@inheritDoc} */ public Entry translate(final Entry original, final long firstLineNumber) throws LDIFException { final ByteStringBuffer buffer = getBuffer(); if (wrapColumn.isPresent()) { original.toLDIF(buffer, wrapColumn.getValue()); } else { original.toLDIF(buffer, 0); } buffer.append(StaticUtils.EOL_BYTES); return new PreEncodedLDIFEntry(original, buffer.toByteArray()); }
final String[] ldifLines = e.toLDIF(0); for (int i=1; i < ldifLines.length; i++)
final String[] ldifLines = e.toLDIF(80); for (final String line : ldifLines)
e.toLDIF(buffer, 0); buffer.append(StaticUtils.EOL_BYTES);
final Entry addEntry = new Entry(addRecord.getDN(), addRecord.getAttributes()); final String[] entryLdifLines = addEntry.toLDIF(0); final StringBuilder entryLDIFBuffer = new StringBuilder(); for (int i=1; i < entryLdifLines.length; i++)