Skip navigation links

Oracle Internet Directory API Reference
11g Release 1 (11.1.1)

E10664-01


oracle.ldap.util
Class LDIFReader

java.lang.Object
  extended by oracle.ldap.util.LDIFReader


public class LDIFReader
extends java.lang.Object

LDAP Data Interchange Format (LDIF) is a file format used to represent the Directory entries. The data from the directory can be exported in this format and could be imported into another directory server. LDIF Data can describe a set of changes that needs to be applied to data in a directory. This format is described in the Internet draft The LDAP Data Interchange Format (LDIF) - RFC-2849.

This class provides a set of methods to read and manipulate an LDIF file.


Constructor Summary
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.

 

Method Summary
 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.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

LDIFReader

public LDIFReader()
           throws java.io.IOException
Default Constructor, Reads the data from standard input. The input data is required to be present in UTF8 format.
Throws:
java.io.IOException - If an I/O error occurs.

LDIFReader

public LDIFReader(java.lang.String file)
           throws java.io.IOException
Constructs an Input stream reader to read the LDIF data from the file specified.
Parameters:
file - the name of the LDIF file
Throws:
java.io.IOException - If an I/O error occurs.

LDIFReader

public LDIFReader(java.lang.String file,
                  java.lang.String encoding)
           throws java.io.IOException
Constructs an Input stream reader to read the LDIF data from the file specified.
Parameters:
file - the name of the LDIF file
encoding - the character encoding of the file
Throws:
java.io.IOException - If an I/O error occurs.

LDIFReader

public LDIFReader(java.io.File fileObj)
           throws java.io.IOException
Constructs an Input stream reader to read the LDIF data from the file object specified.
Parameters:
fileObj - The file object of the LDIF file
Throws:
java.io.IOException - If an I/O error occurs.

LDIFReader

public LDIFReader(java.io.File fileObj,
                  java.lang.String encoding)
           throws java.io.IOException
Constructs an Input stream reader to read the LDIF data from the file object specified.
Parameters:
fileObj - The file object of the LDIF file
encoding - the character encoding of the file
Throws:
java.io.IOException - If an I/O error occurs.

LDIFReader

public LDIFReader(java.io.InputStream ds)
           throws java.io.IOException
Constructs an Input stream reader to read the LDIF data from the specified input stream.
Parameters:
ds - - the input stream providing the LDIF data
Throws:
java.io.IOException - If an I/O error occurs.

LDIFReader

public LDIFReader(java.io.InputStream ds,
                  java.lang.String encoding)
           throws java.io.IOException
Constructs an Input stream reader to read the LDIF data from the specified input stream.
Parameters:
ds - the input stream providing the LDIF data
encoding - the character encoding of the input byte stream
Throws:
java.io.IOException - If an I/O error occurs.

Method Detail

getReadCount

public long getReadCount()
Returns the number of bytes read from the LDIF file.

setBinaryAttributes

public void setBinaryAttributes(java.lang.String[] attrNames)
Specify the attribute list whose values should be treates as binary sequence.
Parameters:
attrNames - an array containing attribute names.

nextEntry

public java.util.Vector nextEntry()
                           throws java.io.IOException
Returns the next entry in the LDIF file. Using this method you can iterate thru all the entries in the LDIF file.
Returns:
the next entry as a vector object containing the attributes as name:value pairs.i.e each element in the vector will look like name:vlaue. A null is returned if there are no more entries.
Throws:
java.io.IOException - If an I/O error occurs.

nextRecord

public LDIFRecord nextRecord()
                      throws java.io.IOException
Returns the next record in the LDIF file. Using this method you can iterate thru all the entries in the LDIF file.
Returns:
the next entry as a LDIFRecord object. A null is returned if there are no more entries.
Throws:
java.io.IOException - If an I/O error occurs.

close

public void close()
           throws java.io.IOException
Closes the stream.
Throws:
java.io.IOException - If an error occurs.

getVersion

public java.lang.String getVersion()
Return the version attribute specified in the LDIF file.
Returns:
the version string specified in the LDIF file.

setReadFileContentForAttrib

public 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. in case of unix the file name begins with '/' and in case of NT the file name contains ':'
Parameters:
bool - boolean value to be set.

main

public static void main(java.lang.String[] args)

Skip navigation links

Oracle Internet Directory API Reference
11g Release 1 (11.1.1)

E10664-01


Copyright © 1999, 2009 Oracle. All Rights Reserved.