public class LDIFReader
extends java.lang.Object
This class provides a set of methods to read and manipulate an LDIF file.
| Constructor and Description |
|---|
LDIFReader()
Default Constructor, Reads the data from standard input.
|
LDIFReader(java.io.File fileObj)
Constructs an Input stream reader to read the LDIF data from the
file object specified.
|
LDIFReader(java.io.File fileObj,
java.lang.String encoding)
Constructs an Input stream reader to read the LDIF data from the
file object specified.
|
LDIFReader(java.io.InputStream ds)
Constructs an Input stream reader to read the LDIF data from the
specified input stream.
|
LDIFReader(java.io.InputStream ds,
java.lang.String encoding)
Constructs an Input stream reader to read the LDIF data from the
specified input stream.
|
LDIFReader(java.lang.String file)
Constructs an Input stream reader to read the LDIF data from the
file specified.
|
LDIFReader(java.lang.String file,
java.lang.String encoding)
Constructs an Input stream reader to read the LDIF data from the
file specified.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the stream.
|
long |
getReadCount()
Returns the number of bytes read from the LDIF file.
|
java.lang.String |
getVersion()
Return the version attribute specified in the LDIF file.
|
static void |
main(java.lang.String[] args) |
java.util.Vector |
nextEntry()
Returns the next entry in the LDIF file.
|
LDIFRecord |
nextRecord()
Returns the next record in the LDIF file.
|
void |
setBinaryAttributes(java.lang.String[] attrNames)
Specify the attribute list whose values should be treates as binary
sequence.
|
void |
setReadFileContentForAttrib(boolean bool)
if set, the attribute value will be treated as a file name
and the contents of which will be taken as the attribute value.
|
public LDIFReader()
throws java.io.IOException
java.io.IOException - If an I/O error occurs.public LDIFReader(java.lang.String file)
throws java.io.IOException
file - the name of the LDIF filejava.io.IOException - If an I/O error occurs.public LDIFReader(java.lang.String file,
java.lang.String encoding)
throws java.io.IOException
file - the name of the LDIF fileencoding - the character encoding of the filejava.io.IOException - If an I/O error occurs.public LDIFReader(java.io.File fileObj)
throws java.io.IOException
fileObj - The file object of the LDIF filejava.io.IOException - If an I/O error occurs.public LDIFReader(java.io.File fileObj,
java.lang.String encoding)
throws java.io.IOException
fileObj - The file object of the LDIF fileencoding - the character encoding of the filejava.io.IOException - If an I/O error occurs.public LDIFReader(java.io.InputStream ds)
throws java.io.IOException
ds - - the input stream providing the LDIF datajava.io.IOException - If an I/O error occurs.public LDIFReader(java.io.InputStream ds,
java.lang.String encoding)
throws java.io.IOException
ds - the input stream providing the LDIF dataencoding - the character encoding of the input byte streamjava.io.IOException - If an I/O error occurs.public long getReadCount()
public void setBinaryAttributes(java.lang.String[] attrNames)
attrNames - an array containing attribute names.public java.util.Vector nextEntry()
throws java.io.IOException
java.io.IOException - If an I/O error occurs.public LDIFRecord nextRecord() throws java.io.IOException
java.io.IOException - If an I/O error occurs.public void close()
throws java.io.IOException
java.io.IOException - If an error occurs.public java.lang.String getVersion()
public void setReadFileContentForAttrib(boolean bool)
bool - boolean value to be set.public static void main(java.lang.String[] args)