continue;
}
String mode = filter.hasProperty(JcrPackageDefinitionImpl.PN_MODE)
? filter.getProperty(JcrPackageDefinitionImpl.PN_MODE).getString()
: "";
PathFilterSet set = new PathFilterSet(root);
if (mode.length() > 0) {
set.setImportMode(ImportMode.valueOf(mode.toUpperCase()));
}
if (filter.hasProperty(JcrPackageDefinitionImpl.PN_RULES)) {
// new version with mv rules property
Property p = filter.getProperty(JcrPackageDefinitionImpl.PN_RULES);
Value[] values = p.getDefinition().isMultiple() ? p.getValues() : new Value[]{p.getValue()};
for (Value value: values) {
String rule = value.getString();
int idx = rule.indexOf(':');
String type = idx > 0 ? rule.substring(0, idx) : "include";
String patt = idx > 0 ? rule.substring(idx + 1) : "";
DefaultPathFilter pf = new DefaultPathFilter(patt);
if (type.equals("include")) {
set.addInclude(pf);
} else {
set.addExclude(pf);
}
}
} else {
for (NodeIterator rules = filter.getNodes(); rules.hasNext();) {
Node rule = rules.nextNode();
String type = rule.getProperty(JcrPackageDefinitionImpl.PN_TYPE).getString();
String pattern = rule.getProperty(JcrPackageDefinitionImpl.PN_PATTERN).getString();
DefaultPathFilter pf = new DefaultPathFilter(pattern);
if (type.equals("include")) {
set.addInclude(pf);
} else {
set.addExclude(pf);
}
}
}
wsp.add(set);
}