/** * Determine the {@link Path} from an {@link ItemId}. * @param itemId * @return path of the item <code>itemId</code> or <code>null</code> if <code>itemId</code>'s * path is not absolute */ protected static Path getPath(ItemId itemId) { Path path = itemId.getPath(); if (path != null && !path.isAbsolute()) { return null; } return path; }
/** * Determine the {@link Path} from an {@link ItemId}. * @param itemId * @return path of the item <code>itemId</code> or <code>null</code> if <code>itemId</code>'s * path is not absolute */ protected static Path getPath(ItemId itemId) { Path path = itemId.getPath(); if (path != null && !path.isAbsolute()) { return null; } return path; }
/** * Sets the relative path to the property in this relation. * * @param relPath the relative path to a property. * @throws IllegalArgumentException if <code>relPath</code> is absolute. */ public void setRelativePath(Path relPath) { if (relPath.isAbsolute()) { throw new IllegalArgumentException("relPath must be relative"); } Element[] elements = relPath.getElements(); for (Element element : elements) { addPathElement(element); } }
DescendantNodeImpl(NamePathResolver resolver, Name selectorName, Path path) throws InvalidQueryException, NamespaceException { super(resolver); this.selectorName = selectorName; this.path = path; if (!path.isAbsolute()) { throw new InvalidQueryException(resolver.getJCRPath(path) + " is not an absolute path"); } }
SameNodeImpl(NamePathResolver resolver, Name selectorName, Path path) throws InvalidQueryException, RepositoryException { super(resolver); this.selectorName = selectorName; this.path = path; if (!path.isAbsolute()) { throw new InvalidQueryException(resolver.getJCRPath(path) + " is not an absolute path"); } }
DescendantNodeImpl(NamePathResolver resolver, Name selectorName, Path path) throws InvalidQueryException, NamespaceException { super(resolver); this.selectorName = selectorName; this.path = path; if (!path.isAbsolute()) { throw new InvalidQueryException(resolver.getJCRPath(path) + " is not an absolute path"); } }
SameNodeImpl(NamePathResolver resolver, Name selectorName, Path path) throws InvalidQueryException, RepositoryException { super(resolver); this.selectorName = selectorName; this.path = path; if (!path.isAbsolute()) { throw new InvalidQueryException(resolver.getJCRPath(path) + " is not an absolute path"); } }
ChildNodeImpl(NamePathResolver resolver, Name selectorName, Path path) throws InvalidQueryException, RepositoryException { super(resolver); this.selectorName = selectorName; this.path = path; if (!path.isAbsolute()) { throw new InvalidQueryException(resolver.getJCRPath(path) + " is not an absolute path"); } }
ChildNodeImpl(NamePathResolver resolver, Name selectorName, Path path) throws InvalidQueryException, RepositoryException { super(resolver); this.selectorName = selectorName; this.path = path; if (!path.isAbsolute()) { throw new InvalidQueryException(resolver.getJCRPath(path) + " is not an absolute path"); } }
/** * @see AccessManager#isGranted(Path, int) */ public boolean isGranted(Path absPath, int permissions) throws RepositoryException { checkInitialized(); if (!absPath.isAbsolute()) { throw new RepositoryException("Absolute path expected"); } return compiledPermissions.grants(absPath, permissions); }
/** * @see AccessManager#isGranted(Path, int) */ public boolean isGranted(Path absPath, int permissions) throws RepositoryException { checkInitialized(); if (!absPath.isAbsolute()) { throw new RepositoryException("Absolute path expected"); } return compiledPermissions.grants(absPath, permissions); }
private Path getAbsolutePath(PathResolver resolver, String path) throws RepositoryException { try { Path qpath = resolver.getQPath(path).getNormalizedPath(); if (!qpath.isAbsolute()) { throw new RepositoryException("Path is not absolute: " + path); } return qpath; } catch (NameException e) { throw new RepositoryException("Path is invalid: " + path, e); } }
private Path getAbsolutePath(PathResolver resolver, String path) throws RepositoryException { try { Path qpath = resolver.getQPath(path).getNormalizedPath(); if (!qpath.isAbsolute()) { throw new RepositoryException("Path is not absolute: " + path); } return qpath; } catch (NameException e) { throw new RepositoryException("Path is invalid: " + path, e); } }
/** * @see AbstractCompiledPermissions#buildResult(Path) */ @Override protected synchronized Result buildResult(Path absPath) throws RepositoryException { if (!absPath.isAbsolute()) { throw new RepositoryException("Absolute path expected."); } boolean isAcItem = isAcItem(absPath); String jcrPath = session.getJCRPath(absPath); // retrieve principal-based permissions and privileges return buildResult(jcrPath, isAcItem); }
/** * @see AbstractCompiledPermissions#buildResult(Path) */ @Override protected synchronized Result buildResult(Path absPath) throws RepositoryException { if (!absPath.isAbsolute()) { throw new RepositoryException("Absolute path expected."); } boolean isAcItem = isAcItem(absPath); String jcrPath = session.getJCRPath(absPath); // retrieve principal-based permissions and privileges return buildResult(jcrPath, isAcItem); }
/** * @see AbstractAccessControlManager#checkValidNodePath(String) */ @Override protected void checkValidNodePath(String absPath) throws PathNotFoundException, RepositoryException { Path p = getPath(absPath); if (p != null) { if (!p.isAbsolute()) { throw new RepositoryException("Absolute path expected."); } if (hierMgr.resolveNodePath(p) == null) { throw new PathNotFoundException("No such node " + absPath); } } }
/** * @see AbstractAccessControlManager#checkValidNodePath(String) */ @Override protected void checkValidNodePath(String absPath) throws PathNotFoundException, RepositoryException { if (absPath != null) { Path path = resolver.getQPath(absPath); if (!path.isAbsolute()) { throw new RepositoryException("Absolute path expected. Found: " + absPath); } if (hierMgr.resolveNodePath(path) == null) { throw new PathNotFoundException(absPath); } } }
private void checkValidNodePath(String absPath) throws PathNotFoundException, RepositoryException { if (absPath != null) { Path qPath = npResolver.getQPath(absPath); if (!qPath.isAbsolute()) { throw new RepositoryException("Absolute path expected. Found: " + absPath); } if (hierarchyManager.getNodeEntry(qPath).getNodeState() == null) { throw new PathNotFoundException(absPath); } } }
private void checkValidNodePath(String absPath) throws PathNotFoundException, RepositoryException { if (absPath != null) { Path qPath = npResolver.getQPath(absPath); if (!qPath.isAbsolute()) { throw new RepositoryException("Absolute path expected. Found: " + absPath); } if (hierarchyManager.getNodeEntry(qPath).getNodeState() == null) { throw new PathNotFoundException(absPath); } } }
public NodeImpl getImportTargetNode() throws RepositoryException { try { Path p = session.getQPath(parentAbsPath).getNormalizedPath(); if (!p.isAbsolute()) { throw new RepositoryException("not an absolute path: " + parentAbsPath); } return session.getItemManager().getNode(p); } catch (NameException e) { String msg = parentAbsPath + ": invalid path"; throw new RepositoryException(msg, e); } catch (AccessDeniedException ade) { throw new PathNotFoundException(parentAbsPath); } }