public LuceneDoc(String path, SearchContext sc) { this.path = path; this.sc = sc; this.depth = PathUtils.getDepth(path); }
public LuceneDoc(String path, SearchContext sc) { this.path = path; this.sc = sc; this.depth = PathUtils.getDepth(path); }
@Override public boolean apply(@Nullable String input) { return input != null && PathUtils.getDepth(input) >= level; } });
@Override public boolean apply(@Nullable String input) { return input != null && PathUtils.getDepth(input) >= level; } });
private Set<String> unprecisePaths(Set<String> paths, int level) { Set<String> result = new HashSet<String>(); for (String path : paths) { String unprecise = path; while(PathUtils.getDepth(unprecise) > level) { unprecise = PathUtils.getParentPath(unprecise); } result.add(unprecise); } return result; }
private void setParentPath(String relativePath){ parentPathSegment = "/" + relativePath; if (relativePath.isEmpty()){ // we only restrict non-full-text conditions if there is // no relative property in the full-text constraint enableNonFullTextConstraints(); } else { relativize = true; parentDepth = getDepth(relativePath); } }
private static String getPathWithMaxDepth(String path, int maxDepth){ int depth = PathUtils.getDepth(path); if (depth <= maxDepth){ return path; } return PathUtils.getAncestorPath(path, depth - maxDepth); }
@Override public Editor childNodeAdded(String name, NodeState after) throws CommitFailedException { int d = getDepth(path); // allow child nodes under version storage node, unless an attempt // is made to create rep:versionStorage nodes manually. if (d == getDepth(VERSION_STORE_PATH) && !isVersionStorageNode(after)) { return null; } return throwProtected(name); }
private Set<String> unprecisePaths(Set<String> paths, int level) { Set<String> result = new HashSet<String>(); for (String path : paths) { String unprecise = path; while(PathUtils.getDepth(unprecise) > level) { unprecise = PathUtils.getParentPath(unprecise); } result.add(unprecise); } return result; }
private Set<String> unprecisePaths(Set<String> paths, int level) { Set<String> result = new HashSet<String>(); for (String path : paths) { String unprecise = path; while(PathUtils.getDepth(unprecise) > level) { unprecise = PathUtils.getParentPath(unprecise); } result.add(unprecise); } return result; }
private static String getPathWithMaxDepth(String path, int maxDepth){ int depth = PathUtils.getDepth(path); if (depth <= maxDepth){ return path; } return PathUtils.getAncestorPath(path, depth - maxDepth); }
@Override public Iterable<Tree> children(@NotNull Tree root) { //Break at maxLevel if (PathUtils.getDepth(root.getPath()) >= maxDepth) { return Collections.emptyList(); } return root.getChildren(); } };
@Override public void onCreateNodeObject(String path) { nodePathDepths.update(PathUtils.getDepth(path)); if (countPaths) { updatePathCount(path); } }
@Override public void propertyAdded(PropertyState after) throws CommitFailedException { if (getDepth(path) < VERSION_HISTORY_DEPTH) { return; } throwProtected(after.getName()); }
@Override public void propertyAdded(PropertyState after) throws CommitFailedException { if (getDepth(path) < VERSION_HISTORY_DEPTH) { return; } throwProtected(after.getName()); }
@Override public void propertyChanged(PropertyState before, PropertyState after) throws CommitFailedException { if (getDepth(path) < VERSION_HISTORY_DEPTH) { return; } throwProtected(before.getName()); }
@Override public void propertyDeleted(PropertyState before) throws CommitFailedException { if (getDepth(path) < VERSION_HISTORY_DEPTH) { return; } throwProtected(before.getName()); }
@Override public void propertyAdded(PropertyState after) throws CommitFailedException { if (getDepth(path) < VERSION_HISTORY_DEPTH) { return; } throwProtected(after.getName()); }
private static PropertyState getValue(NodeState node, String propertyRelativePath) { int depth = PathUtils.getDepth(propertyRelativePath); NodeState propNode = node; String propName = propertyRelativePath; if (depth > 1) { propName = PathUtils.getName(propertyRelativePath); String parentPath = PathUtils.getParentPath(propertyRelativePath); propNode = NodeStateUtils.getNode(node, parentPath); } return propNode.getProperty(propName); } }