org.apache.jackrabbit.vault.fs.api.WorkspaceFilter.getCoveringFilterSet()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(98)

本文整理了Java中org.apache.jackrabbit.vault.fs.api.WorkspaceFilter.getCoveringFilterSet()方法的一些代码示例,展示了WorkspaceFilter.getCoveringFilterSet()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WorkspaceFilter.getCoveringFilterSet()方法的具体详情如下:
包路径:org.apache.jackrabbit.vault.fs.api.WorkspaceFilter
类名称:WorkspaceFilter
方法名:getCoveringFilterSet

WorkspaceFilter.getCoveringFilterSet介绍

[英]Returns the filter set that covers the respective node path
[中]返回覆盖相应节点路径的筛选器集

代码示例

代码示例来源:origin: org.apache.jackrabbit.vault/org.apache.jackrabbit.vault

Node n = nIter.nextNode();
String path = n.getPath();
PathFilterSet coverSet = filter.getCoveringFilterSet(path);
boolean isAncestor = filter.isAncestor(path);
boolean isIncluded = filter.contains(path);

代码示例来源:origin: net.adamcin.granite/granite-client-packman

protected static ValidationResult checkDeniedPathInclusion(ValidationOptions options, VaultPackage pack) {
  List<String> pathsDeniedForInclusion = options.getPathsDeniedForInclusion();
  if (pathsDeniedForInclusion != null) {
    for (String path : pathsDeniedForInclusion) {
      if (pack.getMetaInf().getFilter().contains(path)) {
        WspFilter.Root invalidRoot = null;
        PathFilterSet filter = pack.getMetaInf().getFilter().getCoveringFilterSet(path);
        if (filter != null) {
          invalidRoot = WspFilter.adaptFilterSet(filter);
        }
        return ValidationResult.deniedPathInclusion(path, invalidRoot);
      }
    }
  }
  return ValidationResult.success();
}

代码示例来源: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();
}

相关文章