directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marina <>
Subject How to import LDIF file programmatically
Date Wed, 09 May 2012 19:58:52 GMT

I'm trying to import my LDIF file (with all users/groups/orgs defined) into a newly created
partition of my my embedded LDAP server. 

I found APIs and examples for how to create a partition programmatically:

JdbmPartition partition = new JdbmPartition();
        partition.setId( partitionId );
        partition.setPartitionDir( new File( service.getWorkingDirectory(), partitionId
) );
        partition.setSuffix( partitionDn );
        service.addPartition( partition );

Now, I would like to add users, etc. from my LDIF file - but I cannot find APIs or examples
for how to do that. I see how I could create each user/org programmatically, but that's not
what I want - I already have the whole hierarchy defined in the LDIF, I don't want to repeat
all that in the code.

If somebody could point me to the APIs that could do that, or provide some examples - it would
be great!


View raw message