netscape.ldap.util
Class LDIFWriter
- Serializable
Class for outputting LDAP entries to a stream as LDIF.
LDIFWriter(PrintWriter pw) - Constructs an
LDIFWriter object to output entries
to a stream as LDIF.
|
LDIFWriter(PrintWriter pw, boolean attrsOnly, String separator, boolean foldLines, boolean toFiles) - Constructs an
LDIFWriter object to output entries
to a stream as LDIF.
|
LDIFWriter
public LDIFWriter(PrintWriter pw)
Constructs an LDIFWriter
object to output entries
to a stream as LDIF.
pw
- output stream
LDIFWriter
public LDIFWriter(PrintWriter pw,
boolean attrsOnly,
String separator,
boolean foldLines,
boolean toFiles)
Constructs an LDIFWriter
object to output entries
to a stream as LDIF.
pw
- output streamattrsOnly
- true
if only attribute names, not
values, are to be printedseparator
- String to use between attribute names and values;
the default is ":"foldLines
- true
to fold lines at 77 characters,
false
to not fold them; the default is true
.toFiles
- true
to write each attribute value to a
file in the temp folder, false
to write them to the
output stream in printable format; the default is false
.
getTempFile
protected FileOutputStream getTempFile(String name)
throws IOException
Create a unique file name in the temp folder and open an
output stream to the file
name
- base name of file; an extension is appended which
consists of a number that makes the name unique
- an open output stream to the file
printAttribute
protected void printAttribute(LDAPAttribute attr)
Print an attribute of an entry
- printAttribute in interface LDAPWriter
attr
- the attribute to format to the output stream
printEntryEnd
protected void printEntryEnd(String dn)
Print epilogue to entry
- printEntryEnd in interface LDAPWriter
dn
- the DN of the entry
printEntryStart
protected void printEntryStart(String dn)
Print prologue to entry
- printEntryStart in interface LDAPWriter
dn
- the DN of the entry
printString
protected void printString(String value)