6

Is it possible to retrieve "everything" (all names) from javax.naming.InitialContext? I didn't find any examples or documentation about it.

yegor256
  • 97,508
  • 114
  • 426
  • 573

2 Answers2

7

Looking at the JavaDoc I can see that .list(String name) will return the list of names in the named context and that .getNameInNamespace() will return the name of the InitialContext. So perhaps you can do:

ctx.list(ctx.getNameInNamespace());
Nick Grealy
  • 21,434
  • 9
  • 96
  • 110
DMKing
  • 1,695
  • 1
  • 10
  • 13
3

It is as simple as:

ctx.list("")

Hexum2600
  • 139
  • 6