protected void createArgumentsForResourceCollections( CommandLineBuilder builder) throws IOException {
Iterator iter = resources.iterator();
boolean filesetFound = false;
while (iter.hasNext())
{
ResourceCollection collection = (ResourceCollection)iter.next();
if (collection instanceof Path)
{
Path path = (Path) collection;
Iterator<?> pathIter = path.iterator();
while (pathIter.hasNext()) {
ResourceCollection c = (ResourceCollection) pathIter.next();
if (c instanceof AbstractFileSet) {
AbstractFileSet fs = (AbstractFileSet) c;
builder.addArg("--basedir", baseDir(fs));
createArgumentsForFilenames( builder, getFilenames(fs));
} else if (c instanceof FileResource) {
FileResource f = (FileResource) c;
if (f.getFile().isDirectory()) {
// directory
FileSet fs = new FileSet();
fs.setProject(getProject());
fs.setDir(f.getFile());
builder.addArg("--basedir", baseDir(fs));
createArgumentsForFilenames( builder, getFilenames(fs));
} else {
System.err.println("Unexpected type " + c.getClass().getName() + " " + c.toString());
}
} else {
System.err.println("Unexpected type " + c.getClass().getName() + " " + c.toString());
}
}
}
else if (collection instanceof FileSet)
{