FileDocCategorySizeDatePackage
Util.javaAPI DocphoneME MR2 API (J2ME)2053Wed May 02 17:59:48 BST 2007util

Util

public class Util extends Object
Miscellaneous methods used by buildtool.jar

Fields Summary
Constructors Summary
Methods Summary
public static java.util.Hashtablegetenv()

        Process p;
        if (File.separator.equals("\\")) {
            p = Runtime.getRuntime().exec("cmd /c set");
        } else {
            p = Runtime.getRuntime().exec("printenv");
        }

        InputStream in = p.getInputStream();
        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        String line;
        Hashtable table = new Hashtable();
        
        while ((line = reader.readLine()) != null) {
            int i = line.indexOf('=");
            if (i > 0) {
                String name = line.substring(0, i);
                String value = line.substring(i+1);
                table.put(name, value);
            }
        }

        in.close();
        p.waitFor();
        return table;