Does anyone have problem with using LdifReader. The code that i using is this:
LdifReader reader = new LdifReader();
List entries = reader.parseLdifFile("/tmp/file.ldif");
for (LdifEntry entry : entries) {
System.out.println(entry.get("cn"));
}
The problem is that every time that i execute code give me different result and sometimes are not displayed all entries. With different result i mean if ldif file have this data: Entry 1: ... Entry2: ... .... Entry n: ... Entry n+1: ... If i execute will give some output entry1, entry2. ... entryN, next run on some code will produce output with same entries, but in different order and so on. The main problem is that even if i remove this:
for (LdifEntry entry : entries) {
System.out.println(entry.get("cn")); }
There will be output with all data from particular entries(not all) , and i don’t know where is the problem. If in “for” i put something like this
System.out.println(“testing”);
this will not be printed in most of the runs. Any help is welcomed.