|
LDAP Classes Implements Java LDAP |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.novell.ldap.util.LDIFWriter
LDIFWriter is used to write LDIF content records or LDIF change records to the OutputStream object.
The object of the class is used to generate LDIF content record or LDIF change record lines and write the lines to OUtputStream
Constructor Summary | |
LDIFWriter(java.io.OutputStream out)
Constructs an LDIFWriter object. |
|
LDIFWriter(java.io.OutputStream out,
java.lang.String version,
boolean request)
Constructs an LDIFWriter object. |
Method Summary | |
void |
finish()
Write all remaining data to the output stream |
java.lang.String |
getVersion()
Gets the version of the LDIF data associated with the input stream |
boolean |
isPrintable(byte[] bytes)
Check if the input byte array object is safe to make a String. |
boolean |
isRequest()
Returns true if request data ist associated with the input stream, or false if content data. |
void |
writeComments(java.lang.String line)
Write a comment line into the LDIF OutputStream. |
void |
writeEntry(LDAPEntry entry)
Write an LDAP record into LDIF file as LDAPContent data. |
void |
writeEntry(LDAPEntry entry,
LDAPControl[] controls)
Write an LDAP record into LDIF file as LDAPContent data. |
void |
writeError(java.lang.Exception e)
Writes an exception as a comment in LDIF. |
void |
writeMessage(LDAPMessage request)
Write an LDAP record into LDIF file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LDIFWriter(java.io.OutputStream out) throws java.io.IOException
If the first message is one of LDAPAddRequest, LDAPDeleteRequest, LDAPModifyDNRequest, or LDAPModifyRequest the file will be writen as an LDAP request (change) file.
If the first message written to the file is an LDAPSearchResult object an LDIF content file will be written.
You are not allowed to mix request data and content data
out
- The OutputStream where the LDIF data will be written.
java.io.IOException
- for errors writing to the stream.public LDIFWriter(java.io.OutputStream out, java.lang.String version, boolean request) throws java.io.IOException
out
- The OutputStream where the LDIF data will be written.version
- The version to set in the LDIF file, must be "1".request
- If true sets the out file type to request (change) data,
else the file type will be content.
java.io.IOException
Method Detail |
public void writeEntry(LDAPEntry entry) throws java.io.IOException
You are not allowed to mix request data and content data
writeEntry
in interface LDAPWriter
entry
- LDAPEntry object
java.io.IOException
- if an I/O error occurs.LDAPEntry
public void writeEntry(LDAPEntry entry, LDAPControl[] controls) throws java.io.IOException
You are not allowed to mix request data and content data
writeEntry
in interface LDAPWriter
entry
- LDAPEntry objectcontrols
- Controls that were returned with this entry
java.io.IOException
- if an I/O error occurs.LDAPEntry
public void writeMessage(LDAPMessage request) throws java.io.IOException
You are not allowed to mix request data and content data
writeMessage
in interface LDAPWriter
request
- LDAPMessage object
java.io.IOException
- if an I/O error occurs.LDAPSearchResults
,
LDAPAddRequest
,
LDAPDeleteRequest
,
LDAPModifyDNRequest
,
LDAPModifyRequest
public void writeComments(java.lang.String line) throws java.io.IOException
an '#' char is added to the front of each line to indicate that the line is a comment line. If a line contains more than 78 chars, it will be split into multiple lines each of which starts with '#'
writeComments
in interface LDAPWriter
line
- The comment lines to be written to the OutputStream
java.io.IOException
- if an I/O error occurs.public void writeError(java.lang.Exception e) throws java.io.IOException
writeError
in interface LDAPWriter
e
- Exception to be written.
java.io.IOException
public java.lang.String getVersion()
getVersion
in interface LDAPWriter
public boolean isRequest()
isRequest
in interface LDAPWriter
public boolean isPrintable(byte[] bytes)
Check if the input byte array contains any un-printable value
bytes
- The byte array object to be checked.
public void finish() throws java.io.IOException
finish
in interface LDAPWriter
java.io.IOException
|
LDAP Classes Implements Java LDAP |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |