directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Zoerner <ste...@labeo.de>
Subject Re: [JNDI] Navigating the DIT
Date Wed, 11 Apr 2007 18:06:08 GMT
Ole Ersoy wrote:
> 
> Something like
> ctx.getChildren()...which would delegate to how jndi does this...
> ctx.getChild(name)....

Hi Ole!

For looking up children I would recommend to use the list or 
listBindings methods. If you need the children of ctx, you can simply 
call ctx.listBindings(""), something like this (no compilation done)

NamingEnumeration enm = ctx.listBindings("");
while (enm.hasMore()) {
   Binding b = (Binding) enm.next();
   if (b.getObject() instanceof Context) {
     Context child = (Context) b.getObject();
   }
}

Greetings from Hamburg,
     Stefan



Mime
View raw message