public void produce() throws DataSetException {
File dir = new File(_theDirectory);
if (!dir.isDirectory()) {
throw new DataSetException("'" + _theDirectory + "' should be a directory");
}
_consumer.startDataSet();
try {
List tableSpecs = CsvProducer.getTables(dir.toURL(), "table-ordering.txt");
for (Iterator tableIter = tableSpecs.iterator(); tableIter.hasNext();) {
String table = (String) tableIter.next();
try {
produceFromFile(new File(dir, table + ".csv"));
} catch (CsvParserException e) {
throw new DataSetException("error producing dataset for table '" + table + "'", e);
} catch (DataSetException e) {
throw new DataSetException("error producing dataset for table '" + table + "'", e);
}
}
_consumer.endDataSet();
} catch (IOException e) {
throw new DataSetException("error getting list of tables", e);
}
}