if (c == null)
throw new CommandException(new Exception(),
"No current context");
try {
Hashtable env = NamingShell.getInitialContext().getEnvironment();
Enumeration envEnum = env.keys();
String key;
while (envEnum.hasMoreElements()) {
key = (String)envEnum.nextElement();
System.out.println(key + "\t" + env.get(key));
}
Hashtable sysProps = System.getProperties();
Enumeration sysEnum = sysProps.keys();
while (sysEnum.hasMoreElements()) {
key = (String)sysEnum.nextElement();
System.out.println(key + "\t" + sysProps.get(key));
}
}
catch (NamingException ne) {
throw new CommandException(ne, "Couldn't get the environment of "
+ NamingShell.getCurrentContext());
}