public final class LDIFEntryWriter extends Object implements EntryWriter
| Constructor and Description |
|---|
LDIFEntryWriter(List<String> ldifLines)
Creates a new LDIF entry writer which will append lines of LDIF to the
provided list.
|
LDIFEntryWriter(OutputStream out)
Creates a new LDIF entry writer whose destination is the provided output
stream.
|
LDIFEntryWriter(Writer writer)
Creates a new LDIF entry writer whose destination is the provided
character stream writer.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this entry writer, flushing it first.
|
void |
flush()
Flushes this entry writer so that any buffered data is written
immediately to underlying stream, flushing the stream if it is also
Flushable. |
LDIFEntryWriter |
setAddUserFriendlyComments(boolean addUserFriendlyComments)
Specifies whether or not user-friendly comments should be added whenever
distinguished names or UTF-8 attribute values are encountered which
contained non-ASCII characters.
|
LDIFEntryWriter |
setExcludeAllOperationalAttributes(boolean excludeOperationalAttributes)
Specifies whether or not all operational attributes should be excluded
from any entries that are written to LDIF.
|
LDIFEntryWriter |
setExcludeAllUserAttributes(boolean excludeUserAttributes)
Specifies whether or not all user attributes should be excluded from any
entries that are written to LDIF.
|
LDIFEntryWriter |
setExcludeAttribute(AttributeDescription attributeDescription)
Excludes the named attribute from any entries that are written to LDIF.
|
LDIFEntryWriter |
setExcludeBranch(DN excludeBranch)
Excludes all entries beneath the named entry (inclusive) from being
written to LDIF.
|
LDIFEntryWriter |
setExcludeFilter(Matcher excludeFilter)
Excludes all entries which match the provided filter matcher from being
written to LDIF.
|
LDIFEntryWriter |
setIncludeAttribute(AttributeDescription attributeDescription)
Ensures that the named attribute is not excluded from any entries that
are written to LDIF.
|
LDIFEntryWriter |
setIncludeBranch(DN includeBranch)
Ensures that all entries beneath the named entry (inclusive) are written
to LDIF.
|
LDIFEntryWriter |
setIncludeFilter(Matcher includeFilter)
Ensures that all entries which match the provided filter matcher are
written to LDIF.
|
LDIFEntryWriter |
setWrapColumn(int wrapColumn)
Specifies the column at which long lines should be wrapped.
|
static String |
toString(Entry entry)
Returns the LDIF string representation of the provided entry.
|
LDIFEntryWriter |
writeComment(CharSequence comment)
Writes a comment.
|
LDIFEntryWriter |
writeEntry(Entry entry)
Writes an entry.
|
public LDIFEntryWriter(List<String> ldifLines)
ldifLines - The list to which lines of LDIF should be appended.public LDIFEntryWriter(OutputStream out)
out - The output stream to use.public LDIFEntryWriter(Writer writer)
writer - The character stream writer to use.public static String toString(Entry entry)
entry - The entry.public void close() throws IOException
close in interface Closeableclose in interface AutoCloseableclose in interface EntryWriterIOException - If an unexpected IO error occurred while closing.public void flush() throws IOException
Flushable.
If the intended destination of this stream is an abstraction provided by the underlying operating system, for example a file, then flushing the stream guarantees only that bytes previously written to the stream are passed to the operating system for writing; it does not guarantee that they are actually written to a physical device such as a disk drive.
flush in interface Flushableflush in interface EntryWriterIOException - If an unexpected IO error occurred while flushing.public LDIFEntryWriter setAddUserFriendlyComments(boolean addUserFriendlyComments)
false.addUserFriendlyComments - true if user-friendly comments should be added, or
false otherwise.LDIFEntryWriter.public LDIFEntryWriter setExcludeAllOperationalAttributes(boolean excludeOperationalAttributes)
false.excludeOperationalAttributes - true if all operational attributes should be excluded,
or false otherwise.LDIFEntryWriter.public LDIFEntryWriter setExcludeAllUserAttributes(boolean excludeUserAttributes)
false.excludeUserAttributes - true if all user attributes should be excluded, or
false otherwise.LDIFEntryWriter.public LDIFEntryWriter setExcludeAttribute(AttributeDescription attributeDescription)
attributeDescription - The name of the attribute to be excluded.LDIFEntryWriter.public LDIFEntryWriter setExcludeBranch(DN excludeBranch)
excludeBranch - The distinguished name of the branch to be excluded.LDIFEntryWriter.public LDIFEntryWriter setExcludeFilter(Matcher excludeFilter)
excludeFilter - The filter matcher.LDIFEntryWriter.public LDIFEntryWriter setIncludeAttribute(AttributeDescription attributeDescription)
attributeDescription - The name of the attribute to be included.LDIFEntryWriter.public LDIFEntryWriter setIncludeBranch(DN includeBranch)
includeBranch - The distinguished name of the branch to be included.LDIFEntryWriter.public LDIFEntryWriter setIncludeFilter(Matcher includeFilter)
includeFilter - The filter matcher.LDIFEntryWriter.public LDIFEntryWriter setWrapColumn(int wrapColumn)
wrapColumn - The column at which long lines should be wrapped.LDIFEntryWriter.public LDIFEntryWriter writeComment(CharSequence comment) throws IOException
writeComment in interface EntryWritercomment - The CharSequence to be written as a comment.IOException - If an unexpected IO error occurred while writing the comment.public LDIFEntryWriter writeEntry(Entry entry) throws IOException
writeEntry in interface EntryWriterentry - The Entry to be written.IOException - If an unexpected IO error occurred while writing the entry.Copyright © 2011-2015 ForgeRock AS. All Rights Reserved.