directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel LŽcharny <elecha...@gmail.com>
Subject Re: Deleting a node and it's children
Date Tue, 02 Feb 2010 13:59:00 GMT
pub.cog a écrit :
> Hi,
>
> I'm trying to delete a node of my apacheds using following code:
>
> final CoreSession adminSession = service.getAdminSession();
> final LdapDN ldapDnTmp = new LdapDN(dnTmp);
> if (adminSession.exists(ldapDnTmp)) {
>     adminSession.delete(ldapDnTmp);
> }
>
> where service is a DirectoryService object.
>
> The node I want to delete is not empty so I get a 
> LdapContextNotEmptyException.
>
> Is there any existing method that can delete a node and it's children 
> ? Or do I have to iterate and delete them one by one ?
>
> If I have to iterate, do you have some code sample I could use ? (my 
> node only have objectClass=person)...
You have to iterate. Deletion of a leaf when it has children is 
forbidden by the protocol.

You may find hundreds of sample on google.


Mime
View raw message