InputStream is = KerberosServiceStarter.class.getClassLoader().getResourceAsStream("kerberos/kerberos.ldif");
LdifReader ldifReader = new LdifReader(is);
for (LdifEntry entry : ldifReader) {
if (entry.isChangeAdd()) {
directoryService.getAdminSession().add(new DefaultServerEntry(directoryService.getSchemaManager(), entry.getEntry()));
} else if (entry.isChangeModify()) {
directoryService.getAdminSession().modify(entry.getDn(), entry.getModificationItems());
}
}
ldifReader.close();