mapper.setFrom("*.fo");
mapper.setTo("*" + newExtension);
// deal with the filesets
for (int i = 0; i < task.getFilesets().size(); i++) {
FileSet fs = (FileSet) task.getFilesets().get(i);
DirectoryScanner ds = fs.getDirectoryScanner(task.getProject());
String[] files = ds.getIncludedFiles();
for (int j = 0; j < files.length; j++) {
File f = new File(fs.getDir(task.getProject()), files[j]);
File outf = null;
if (task.getOutdir() != null && files[j].endsWith(".fo")) {
String[] sa = mapper.mapFileName(files[j]);
outf = new File(task.getOutdir(), sa[0]);
} else {
outf = replaceExtension(f, ".fo", newExtension);
if (task.getOutdir() != null) {
outf = new File(task.getOutdir(), outf.getName());
}
}
try {
if (task.getRelativebase()) {
this.baseURL = f.getParentFile().toURL().
toExternalForm();
}
if (this.baseURL == null) {
this.baseURL = fs.getDir(task.getProject()).toURL().
toExternalForm();
}
} catch (Exception e) {
task.log("Error setting base URL", Project.MSG_DEBUG);