use of org.apache.tools.ant.types.resources.Union in project ant by apache.
the class Compare method createControl.
/**
* Create the nested control element. These are the
* resources to compare against.
* @return ResourceCollection.
*/
public synchronized ResourceCollection createControl() {
if (isReference()) {
throw noChildrenAllowed();
}
if (control != null) {
throw oneControl();
}
control = new Union();
setChecked(false);
return control;
}
use of org.apache.tools.ant.types.resources.Union in project ant by apache.
the class Zip method selectOutOfDateResources.
private Resource[] selectOutOfDateResources(final Resource[] initial, final FileNameMapper mapper) {
final Resource[] rs = selectFileResources(initial);
Resource[] result = ResourceUtils.selectOutOfDateSources(this, rs, mapper, getZipScanner(), ZIP_FILE_TIMESTAMP_GRANULARITY);
if (!doFilesonly) {
final Union u = new Union();
u.addAll(Arrays.asList(selectDirectoryResources(initial)));
final ResourceCollection rc = ResourceUtils.selectSources(this, u, mapper, getZipScanner(), MISSING_DIR_PROVIDER);
if (!rc.isEmpty()) {
final List<Resource> newer = new ArrayList<>();
newer.addAll(Arrays.asList(((Union) rc).listResources()));
newer.addAll(Arrays.asList(result));
result = newer.toArray(result);
}
}
return result;
}
use of org.apache.tools.ant.types.resources.Union in project ant by apache.
the class Path method clone.
/**
* Clone this Path.
* @return Path with shallowly cloned Resource children.
*/
@Override
public Object clone() {
try {
Path result = (Path) super.clone();
result.union = union == null ? union : (Union) union.clone();
return result;
} catch (CloneNotSupportedException e) {
throw new BuildException(e);
}
}
Aggregations