FileSet          fileSet    = (FileSet)it.next(); File             fileSetDir = fileSet.getDir(getProject()); DirectoryScanner scanner    = fileSet.getDirectoryScanner(getProject()); String[]         files      = scanner.getIncludedFiles();  for (int idx = 0; (files != null) && (idx < files.length); idx++)
throw new BuildException("Please use either the schemafile attribute or the sub fileset element, but not both"); } if (_singleSchemaFile != null) { model = readSingleSchemaFile(reader, _singleSchemaFile); } else { for (Iterator it = _fileSets.iterator(); it.hasNext();)
    private Database readSchemaFiles()    {        DatabaseReader reader = null;        Database       model  = null;        try        {            reader = new DatabaseReader();        }        catch (IntrospectionException ex)        {            throw new BuildException(ex);        }        for (Iterator it = _fileSets.iterator(); it.hasNext();)        {            FileSet          fileSet    = (FileSet)it.next();            File             fileSetDir = fileSet.getDir(getProject());            DirectoryScanner scanner    = fileSet.getDirectoryScanner(getProject());            String[]         files      = scanner.getIncludedFiles();            for (int idx = 0; (files != null) && (idx < files.length); idx++)            {                File curSchemaFile = new File(fileSetDir, files[idx]);                if (!curSchemaFile.exists())                {                    log("Could not find schema file "+files[idx], Project.MSG_ERR);                }                else if (!curSchemaFile.isFile())                {                    log("Path "+curSchemaFile.getAbsolutePath()+" does not denote a schema file", Project.MSG_ERR);                }                else if (!curSchemaFile.canRead())                {                    log("Could not read schema file "+curSchemaFile.getAbsolutePath(), Project.MSG_ERR);                }                else                {                    Database curModel = null;                    try                    {                        curModel = (Database)reader.parse(curSchemaFile);                        log("Read schema file "+curSchemaFile.getAbsolutePath(), Project.MSG_INFO);                    }                    catch (Exception ex)                    {                        throw new BuildException("Could not read schema file "+curSchemaFile.getAbsolutePath(), ex);                    }                    if (model == null)                    {                        model = curModel;                    }                    else                    {                        try                        {                            model.mergeWith(curModel);                        }                        catch (IllegalArgumentException ex)                        {                            throw new BuildException("Could not merge with schema from file "+files[idx], ex);                        }                    }                }            }        }        return model;    }