{
throw new BuildException("Please use either the datafile attribute or the sub fileset element, but not both");
}
Platform platform = getPlatform();
DataReader dataReader = null;
platform.setIdentityOverrideOn(_useExplicitIdentityValues);
try
{
dataReader = getDataIO().getConfiguredDataReader(platform, model);
dataReader.getSink().start();
if (_singleDataFile != null)
{
readSingleDataFile(task, dataReader, _singleDataFile);
}
else
{
for (Iterator it = _fileSets.iterator(); it.hasNext();)
{
FileSet fileSet = (FileSet)it.next();
File fileSetDir = fileSet.getDir(task.getProject());
DirectoryScanner scanner = fileSet.getDirectoryScanner(task.getProject());
String[] files = scanner.getIncludedFiles();
for (int idx = 0; (files != null) && (idx < files.length); idx++)
{
readSingleDataFile(task, dataReader, new File(fileSetDir, files[idx]));
}
}
}
}
catch (Exception ex)
{
handleException(ex, ex.getMessage());
}
finally
{
if (dataReader != null)
{
dataReader.getSink().end();
}
}
}