FileDocCategorySizeDatePackage
env.javaAPI DocExample1693Wed Apr 05 11:25:42 BST 2000None

env

public class env extends Object implements Command

Fields Summary
Constructors Summary
Methods Summary
public voidexecute(javax.naming.Context c, java.util.Vector v)

            
        if (c == null)
            throw new CommandException(new Exception(),
                "No current context");
        try {
            Hashtable env = NamingShell.getInitialContext().getEnvironment();
            Enumeration enum = env.keys();
            String key;
            while (enum.hasMoreElements()) {
                key = (String)enum.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());
        }
    
public voidhelp()

 System.out.println("Usage: env");