public ParamTable(Vector envParams){ paramTable = new Hashtable();     String envDir  = null; String envFile = null; Vector envPV   = new Vector();  Enumeration ps = envParams.elements(); while(ps.hasMoreElements()){ String envS = (String) ps.nextElement(); Param p = ParamParser.getParam(envS); if (p != null) { envPV.add(p); String n = p.getName(); try { if (n.equals("envDir")){ envDir = p.getStringValue(); } else if (n.equals("envFile")){ envFile = p.getStringValue(); } } catch (Exception e) { System.err.println(e.getMessage()); e.printStackTrace(); } } }   if (envDir == null) envDir = ""; else {  envDir = getWithSlashAppended (envDir); }  String pfile = envDir + envFile; try { InputStream inputStream = ConfigFileFinder.open(pfile);   Parser parser = ParserFactory.makeParser("com.ibm.xml.parsers.SAXParser"); parser.setDocumentHandler(new ParamHandler(this)); parser.setEntityResolver (new UTILEntityResolver ()); parser.parse(new InputSource (inputStream)); } catch(Exception e){ System.err.println(e.getMessage()); e.printStackTrace();  }   for (Enumeration pv = envPV.elements(); pv.hasMoreElements();) { Param p = (Param) pv.nextElement(); addParam(p.getName(), p); } }
private ParamTable() {}
  public ParamTable(Vector envParams){    paramTable = new Hashtable();    // environment parameters are "name={type}value" or "name=StringValue"    // parse parameters.  Remember these special ones: envDir, envFile    String envDir  = null;    String envFile = null;    Vector envPV   = new Vector();    Enumeration ps = envParams.elements();     while(ps.hasMoreElements()){      String envS = (String) ps.nextElement();      Param p = ParamParser.getParam(envS);      if (p != null) {        envPV.add(p);        String n = p.getName();        try {          if (n.equals("envDir")){            envDir = p.getStringValue();	  }          else if (n.equals("envFile")){            envFile = p.getStringValue();	  }        } 	catch (Exception e) { 	  System.err.println(e.getMessage());	  e.printStackTrace();	}      }    }    // set env dir.    if (envDir == null)      envDir = "";    else {	// append slash if needed.	envDir = getWithSlashAppended (envDir);    }    String pfile = envDir + envFile;    try {	InputStream inputStream = ConfigFileFinder.open(pfile);	// must specify which parser to use.	Parser parser = ParserFactory.makeParser("com.ibm.xml.parsers.SAXParser");	parser.setDocumentHandler(new ParamHandler(this));	parser.setEntityResolver (new UTILEntityResolver ());	parser.parse(new InputSource (inputStream));    }    catch(Exception e){      System.err.println(e.getMessage());      e.printStackTrace();//        System.out.println ("Config path is " + ConfigFileFinder.configPath);    }    // add environment parameters, replacing any from file    for (Enumeration pv = envPV.elements(); pv.hasMoreElements();) {      Param p = (Param) pv.nextElement();      addParam(p.getName(), p);    }  }