@SuppressWarnings("unchecked") public void readFile(String fileName) throws JDOMException, IOException {
  if (checkFile(fileName)) {
    Element root=rootFromName(fileName);
    Element roster;
    if (root == null) {
      log.warn("consist file could not be read");
      return;
    }
    roster=root.getChild("roster");
    if (roster == null) {
      log.debug("consist file does not contain a roster entry");
      return;
    }
    Iterator<Element> consistIterator=root.getDescendants(new ElementFilter("consist"));
    try {
      Element consist;
      do {
        consist=consistIterator.next();
        consistFromXml(consist);
      }
 while (consistIterator.hasNext());
    }
 catch (    NoSuchElementException nde) {
      log.debug("end of consist list");
    }
  }
 else {
    log.info("Consist file does not exist.  One will be created if necessary.");
  }
}

@ SuppressWarnings ( "unchecked" ) public void readFile ( String fileName ) throws JDOMException , IOException { if ( checkFile ( fileName ) ) { Element root = rootFromName ( fileName ) ; Element roster ; if ( root == null ) { log . warn ( "consist file could not be read" ) ; return ; } roster = root . getChild ( "roster" ) ; if ( roster == null ) { log . debug ( "consist file does not contain a roster entry" ) ; return ; } Iterator < Element > consistIterator = root . getDescendants ( new ElementFilter ( "consist" ) ) ; try { Element consist ; do { consist = consistIterator . next ( ) ; consistFromXml ( consist ) ; } while ( consistIterator . hasNext ( ) ) ; } catch ( NoSuchElementException nde ) { log . debug ( "end of consist list" ) ; } } else { log . info ( "Consist file does not exist.  One will be created if necessary." ) ; } }
read all consists from a file .
