本文整理了Java中org.apache.jackrabbit.vault.fs.api.WorkspaceFilter.covers()
方法的一些代码示例,展示了WorkspaceFilter.covers()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WorkspaceFilter.covers()
方法的具体详情如下:
包路径:org.apache.jackrabbit.vault.fs.api.WorkspaceFilter
类名称:WorkspaceFilter
方法名:covers
[英]Checks if the given node path is covered in this workspace filter. It only returns true if at least one of the sets covers the path and is not globally ignored.
[中]检查给定的节点路径是否包含在此工作区筛选器中。仅当至少一个集合覆盖路径且未被全局忽略时,才会返回true。
代码示例来源:origin: org.apache.jackrabbit.vault/org.apache.jackrabbit.vault
/**
* Tests if the given workspace filter includes the given property. If the filter does not cover the property,
* it returns {@code true}.
*
* @param filter the workspace filter
* @param propertyPath the path to the property
* @return {@code true} if the property is included in the aggregate
*/
private boolean includesProperty(WorkspaceFilter filter, String propertyPath) {
if (!filter.covers(propertyPath)) {
// include all properties that are not covered by any filter. this is to ensure that the ancestor paths
// have at least jcr:primary type.
return true;
}
for (PathFilterSet filterSet: filter.getPropertyFilterSets()) {
if (filterSet.contains(propertyPath)) {
return true;
}
}
return false;
}
代码示例来源:origin: net.adamcin.granite/granite-client-packman
protected static ValidationResult checkFilter(ValidationOptions options, WspFilter archiveFilter) {
WspFilter wspFilter = options.getValidationFilter();
// skip filter check if validation filter is not specified
if (wspFilter != null) {
WorkspaceFilter filter = convertToWorkspaceFilter(wspFilter);
for (Root archiveRoot : archiveFilter.getRoots()) {
String root = archiveRoot.getPath();
if (filter.covers(root)) {
PathFilterSet covering = filter.getCoveringFilterSet(root);
Root coveringRoot =
WspFilter.adaptFilterSet(covering);
if (!hasRequiredRules(coveringRoot, archiveRoot)) {
return ValidationResult.rootMissingRules(archiveRoot, coveringRoot);
}
} else if (!options.isAllowNonCoveredRoots()) {
return ValidationResult.rootNotAllowed(archiveRoot);
}
}
}
return ValidationResult.success();
}
内容来源于网络,如有侵权,请联系作者删除!