List data;
if (dataXmlFile != null)
{
XmlToData dataXmlParser = new XmlToData(db, dataDTD);
data = dataXmlParser.parseFile(dataXmlFile);
}
else
{
data = new ArrayList();
// Deal with the filesets.
for (int i = 0; i < filesets.size(); i++)
{
FileSet fs = (FileSet) filesets.get(i);
DirectoryScanner ds = fs.getDirectoryScanner(getProject());
File srcDir = fs.getDir(getProject());
String[] dataModelFiles = ds.getIncludedFiles();
// Make a transaction for each file
for (int j = 0; j < dataModelFiles.length; j++)
{
File f = new File(srcDir, dataModelFiles[j]);
XmlToData dataXmlParser = new XmlToData(db, dataDTD);
List newData = dataXmlParser.parseFile(f.toString());
for (Iterator it = newData.iterator(); it.hasNext();)
{
data.add(it.next());
}