static boolean isRelativeProperty(String propertyName){ return !isAbsolute(propertyName) && !FulltextIndexConstants.REGEX_ALL_PROPS.equals(propertyName) && PathUtils.getNextSlash(propertyName, 0) > 0; }
public void testNextSlash() { String path = "/test/a"; int n = PathUtils.getNextSlash(path, 0); assertEquals(0, n); n = PathUtils.getNextSlash(path, n + 1); assertEquals(5, n); n = PathUtils.getNextSlash(path, n + 1); assertEquals(-1, n); }
@NotNull @Override public ItemDelegate perform() throws RepositoryException { String path = item.getPath(); int slash = 0; for (int i = 0; i < depth - 1; i++) { slash = PathUtils.getNextSlash(path, slash + 1); if (slash == -1) { throw new ItemNotFoundException( path + ": Invalid ancestor depth " + depth); } } slash = PathUtils.getNextSlash(path, slash + 1); if (slash == -1) { return item; } NodeDelegate ndlg = sessionDelegate.getNode(path.substring(0, slash)); if (ndlg == null) { throw new ItemNotFoundException(getPath() + "Invalid ancestor depth " + depth); } else { return ndlg; } } });
@NotNull @Override public ItemDelegate perform() throws RepositoryException { String path = item.getPath(); int slash = 0; for (int i = 0; i < depth - 1; i++) { slash = PathUtils.getNextSlash(path, slash + 1); if (slash == -1) { throw new ItemNotFoundException( path + ": Invalid ancestor depth " + depth); } } slash = PathUtils.getNextSlash(path, slash + 1); if (slash == -1) { return item; } NodeDelegate ndlg = sessionDelegate.getNode(path.substring(0, slash)); if (ndlg == null) { throw new ItemNotFoundException(getPath() + "Invalid ancestor depth " + depth); } else { return ndlg; } } });
@Nonnull @Override public ItemDelegate perform() throws RepositoryException { String path = item.getPath(); int slash = 0; for (int i = 0; i < depth - 1; i++) { slash = PathUtils.getNextSlash(path, slash + 1); if (slash == -1) { throw new ItemNotFoundException( path + ": Invalid ancestor depth " + depth); } } slash = PathUtils.getNextSlash(path, slash + 1); if (slash == -1) { return item; } NodeDelegate ndlg = sessionDelegate.getNode(path.substring(0, slash)); if (ndlg == null) { throw new ItemNotFoundException(getPath() + "Invalid ancestor depth " + depth); } else { return ndlg; } } });
PathUtils.getNextSlash(invalid, 0); if (assertsEnabled) { fail();