// respective aggregator building sub aggregates
NodeIterator nIter = node.getNodes();
while (nIter.hasNext()) {
Node n = nIter.nextNode();
String path = n.getPath();
PathFilterSet coverSet = mgr.getWorkspaceFilter().getCoveringFilterSet(path);
boolean isAncestor = mgr.getWorkspaceFilter().isAncestor(path);
boolean isIncluded = mgr.getWorkspaceFilter().contains(path);
if (coverSet == null && !isAncestor) {
continue;
}
// check if another aggregator can handle this node
Aggregator a = mgr.getAggregator(n, path);
// - if the aggregator is null
// - or the aggregator is the same as ours or the default
// - and if we include the content as well
// - then don't use the matched aggregator
if ((a == null)
|| ((a == aggregator || a.isDefault())
&& (aggregator.includes(getNode(), n, path)))) {
// if workspace does not include this node, ignore it
if (!isIncluded && !isAncestor) {
continue;
}
include(n, path);
prepare(n, true);
} else {
// otherwise create sub node and collect items if needed
// but only if the node is either an ancestor or is included
// or if the workspace filter set contains relative pattern (ACL export case).
boolean onlyRelativePatterns = coverSet !=null && coverSet.hasOnlyRelativePatterns();
if (isAncestor || isIncluded || onlyRelativePatterns) {
AggregateImpl sub = new AggregateImpl(this, path, a);
sub.filterArtifacts = !isIncluded && onlyRelativePatterns;
if (leaves == null) {
leaves = new LinkedList<AggregateImpl>();