3

Do you know any java library (or sth other maybe script?) that allows you to 'convert' LDIF to JSON?

JSON data is easier for me to process, So an easy way to make such conversion would be really useful. Also I don't want to reinvent the wheel:)

Cheers

damian
  • 316
  • 3
  • 7
  • 23

1 Answers1

1

This seems to be what you are after.

You should be able to do something like:

StringWriter writer = new StringWriter();
JsonWriter jsonWriter = new JsonWriter(writer);
FileReader reader = new FileReader("entry.ldif");
LdifReader ldifReader = new LdifReader(reader);
SearchResponse result = ldifReader.read();
jsonWriter.write(result);
System.out.println(writer.toString());

Here is a PHP script I found on github as well that does from ldif to JSON or XML. I don't know the quality of it.

Tobb
  • 11,850
  • 6
  • 52
  • 77
Jordan Stewart
  • 3,187
  • 3
  • 25
  • 37