|
Directory SDK for Java 4.19 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnetscape.ldap.util.LDIF
LDAP Data Interchange Format (LDIF) is a file format used to import and export directory data from an LDAP server and to describe a set of changes to be applied to data in a directory. This format is described in the Internet draft The LDAP Data Interchange Format (LDIF) - Technical Specification.
This class implements an LDIF file parser. You can construct
an object of this class to parse data in LDIF format and
manipulate the data as individual LDIFRecord objects.
LDIFRecord,
Serialized Form| Constructor Summary | |
LDIF()
Constructs an LDIF object to parse the
LDAP data read from stdin. |
|
LDIF(DataInputStream ds)
Constructs an LDIF object to parse the
LDIF data read from an input stream. |
|
LDIF(String file)
Constructs an LDIF object to parse the
LDIF data read from a specified file. |
|
| Method Summary | |
static void |
breakString(PrintWriter pw,
String value,
int max)
Outputs the String in LDIF line-continuation format. |
int |
getVersion()
Gets the version of LDIF used in the data. |
static boolean |
isPrintable(byte[] b)
Returns true if all the bytes in the given array are valid for output as a String according to the LDIF specification. |
static void |
main(String[] args)
Test driver - just reads and parses an LDIF file, printing each record as interpreted |
LDIFRecord |
nextRecord()
Returns the next record in the LDIF data. |
static String |
toPrintableString(byte[] b)
Converts a byte array to a printable string following the LDIF rules (encode in base64 if necessary) |
String |
toString()
Gets the string representation of the entire LDIF file. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public LDIF()
throws IOException
LDIF object to parse the
LDAP data read from stdin.
IOException - An I/O error has occurred.
public LDIF(String file)
throws IOException
LDIF object to parse the
LDIF data read from a specified file.
file - the name of the LDIF file to parse
IOException - An I/O error has occurred.
public LDIF(DataInputStream ds)
throws IOException
LDIF object to parse the
LDIF data read from an input stream.
ds - The input stream providing the LDIF data
IOException - An I/O error has occurred.| Method Detail |
public LDIFRecord nextRecord()
throws IOException
LDIFRecord
object or null if there are no more records.
IOException - An I/O error has occurred.LDIFRecordpublic static boolean isPrintable(byte[] b)
true if all the bytes in the given array are valid for
output as a String according to the LDIF specification; otherwise,
false.
public static void breakString(PrintWriter pw,
String value,
int max)
pw - the printer writervalue - the given string being printed outmax - the maximum characters allowed in the linepublic int getVersion()
public String toString()
public static String toPrintableString(byte[] b)
b - the byte array to convert
public static void main(String[] args)
args - name of the LDIF file to parse
|
Directory SDK for Java 4.19 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||