*/
protected void touch() throws BuildException {
long defaultTimestamp = getTimestamp();
if (file != null) {
touch(new FileResource(file.getParentFile(), file.getName()),
defaultTimestamp);
}
if (resources == null) {
return;
}
// deal with the resource collections
for (Resource r : resources) {
Touchable t = r.as(Touchable.class);
if (t == null) {
throw new BuildException("Can't touch " + r);
}
touch(r, defaultTimestamp);
}
// deal with filesets in a special way since the task
// originally also used the directories and Union won't return
// them.
final int size = filesets.size();
for (int i = 0; i < size; i++) {
FileSet fs = (FileSet) filesets.elementAt(i);
DirectoryScanner ds = fs.getDirectoryScanner(getProject());
File fromDir = fs.getDir(getProject());
String[] srcDirs = ds.getIncludedDirectories();
for (int j = 0; j < srcDirs.length; j++) {
touch(new FileResource(fromDir, srcDirs[j]), defaultTimestamp);
}
}
}