public class LdifWriter extends Object implements SearchResultWriter
SearchResult
as LDIF to a Writer
.Modifier and Type | Field and Description |
---|---|
private static int |
COLON_CHAR
ASCII decimal value of colon.
|
private static int |
CR_CHAR
ASCII decimal value of carriage return.
|
private static int |
LA_CHAR
ASCII decimal value of left arrow.
|
private Writer |
ldifWriter
Writer to write to.
|
private static int |
LF_CHAR
ASCII decimal value of line feed.
|
private static String |
LINE_SEPARATOR
Line separator.
|
private static int |
MAX_ASCII_CHAR
ASCII decimal value of highest character.
|
private static int |
NUL_CHAR
ASCII decimal value of nul.
|
private static int |
SP_CHAR
ASCII decimal value of space.
|
Constructor and Description |
---|
LdifWriter(Writer writer)
Creates a new ldif writer.
|
Modifier and Type | Method and Description |
---|---|
protected String |
createLdif(SearchResult result)
Creates an LDIF using the supplied search result.
|
protected String |
createLdifEntry(LdapEntry entry)
Creates an LDIF using the supplied ldap entry.
|
protected String |
createSearchReference(SearchReference ref)
Creates an LDIF using the supplied search reference.
|
private boolean |
encodeData(String data)
Determines whether the supplied data should be base64 encoded.
|
void |
write(SearchResult result)
Writes the supplied search result to the writer.
|
private static final int NUL_CHAR
private static final int LF_CHAR
private static final int CR_CHAR
private static final int SP_CHAR
private static final int COLON_CHAR
private static final int LA_CHAR
private static final int MAX_ASCII_CHAR
private static final String LINE_SEPARATOR
private final Writer ldifWriter
public LdifWriter(Writer writer)
writer
- to write LDIF topublic void write(SearchResult result) throws IOException
write
in interface SearchResultWriter
result
- search result to writeIOException
- if an error occurs using the writerprotected String createLdif(SearchResult result)
result
- search resultprotected String createLdifEntry(LdapEntry entry)
entry
- ldap entryprotected String createSearchReference(SearchReference ref)
ref
- search referenceprivate boolean encodeData(String data)
data
- to inspectCopyright © 2003-2019 Virginia Tech. All Rights Reserved.