public Path getAncestor(int degree) throws IllegalArgumentException, PathNotFoundException { if (degree < 0) { throw new IllegalArgumentException( "/.getAncestor(" + degree + ")"); } else if (degree > 0) { throw new PathNotFoundException( "/.getAncestor(" + degree + ")"); } else { return this; } }
private String toRelativePath(String absPath) throws PathNotFoundException { if (absPath.startsWith("/") && absPath.length() > 1) { return absPath.substring(1); } else { throw new PathNotFoundException("Not an absolute path: " + absPath); } }
@NotNull @Override public Node perform() throws RepositoryException { NodeDelegate nd = node.getChild(oakPath); if (nd == null) { throw new PathNotFoundException(oakPath); } else { return createNode(nd, sessionContext); } } });
@Override public Node getNode(String relPath) throws PathNotFoundException, RepositoryException { if (getWrappedNode().hasNode(relPath)) { return wrapNode(getWrappedNode().getNode(relPath)); } else if (extending && extendedNode.hasNode(relPath)) { return extendedNode.getNode(relPath); } else { throw new PathNotFoundException("Node does not exists: [" + relPath + "]"); } }
@NotNull @Override public Node perform() throws RepositoryException { NodeDelegate nd = node.getChild(oakPath); if (nd == null) { throw new PathNotFoundException(oakPath); } else { return createNode(nd, sessionContext); } } });
@Override public void removeItem(String absPath) throws VersionException, LockException, ConstraintViolationException, AccessDeniedException, RepositoryException { if (!itemExists(absPath)) { throw new PathNotFoundException(absPath); } super.removeItem(absPath); }
@NotNull @Override public PropertyImpl perform() throws RepositoryException { PropertyDelegate pd = node.getPropertyOrNull(oakPath); if (pd == null) { throw new PathNotFoundException( oakPath + " not found on " + node.getPath()); } else { return new PropertyImpl(pd, sessionContext); } } });
@NotNull @Override public T perform() throws RepositoryException { session.refresh(true); NodeDelegate node = session.getNode(path); if (node != null) { return perform(node); } else { throw new PathNotFoundException("Node " + path + " not found"); } }
@Nonnull @Override public PropertyImpl perform() throws RepositoryException { PropertyDelegate pd = node.getPropertyOrNull(oakPath); if (pd == null) { throw new PathNotFoundException( oakPath + " not found on " + node.getPath()); } else { return new PropertyImpl(pd, sessionContext); } } });
public List<NodeDataReader> getNodes(InternalQName name) throws PathNotFoundException { List<NodeDataReader> nr = nodes.get(name).getChildNodesReaders(); if (nr.size() > 0) return nr; throw new PathNotFoundException("Node with name " + parent.getQPath().getAsString() + name.getAsString() + " not found"); }
public List<NodeDataReader> getNodesByType(InternalQName typeName) throws PathNotFoundException { List<NodeDataReader> nr = nodesByType.get(typeName).getChildNodesReaders(); if (nr.size() > 0) return nr; throw new PathNotFoundException("Nodes with type " + typeName.getAsString() + " not found. Parent " + parent.getQPath().getAsString()); }
@Override public Content getAncestor(int level) throws PathNotFoundException, RepositoryException, AccessDeniedException { if (level > this.getLevel()) { throw new PathNotFoundException(); } return wrapAsContent((Node) this.node.getAncestor(level)); }
@Override public Property getProperty(String absPath) throws PathNotFoundException, RepositoryException { Property property = super.getProperty(absPath); if (!contentDecorator.evaluateProperty(property)) { throw new PathNotFoundException(absPath); } return wrapProperty(property); }
@Override public Content getContent(String name) throws RepositoryException { Content inherited = getContentSafely(name); if (inherited == null) { throw new PathNotFoundException("Can't inherit a node [" + name + "] on node [" + getWrappedContent().getHandle() + "]"); } return inherited; }
@Override public Node getNode(String relPath) throws PathNotFoundException, RepositoryException { Node node = super.getNode(relPath); if (!contentDecorator.evaluateNode(node)) { throw new PathNotFoundException(relPath); } return wrapNode(node); }
private void export(String path, Exporter exporter) throws PathNotFoundException, SAXException, RepositoryException { Item item = getItem(path); if (item.isNode()) { exporter.export((Node) item); } else { throw new PathNotFoundException("XML export is not defined for properties: " + path); } }
@Override public void performVoid() throws RepositoryException { session.refresh(true); NodeDelegate node = session.getNode(path); if (node != null) { performVoid(node); } else { throw new PathNotFoundException("Node " + path + " not found"); } }
/** * @see ItemManager#getProperty(Path) */ public synchronized Property getProperty(Path path) throws PathNotFoundException, RepositoryException { PropertyEntry propertyEntry = hierMgr.getPropertyEntry(path); try { return (Property) getItem(propertyEntry); } catch (ItemNotFoundException infe) { throw new PathNotFoundException(LogUtil.safeGetJCRPath(path, session.getPathResolver())); } }
protected PropertyImpl property(InternalQName name) throws IllegalPathException, PathNotFoundException, RepositoryException { PropertyImpl prop = (PropertyImpl)dataManager.getItem(nodeData(), new QPathEntry(name, 1), false, ItemType.PROPERTY); if (prop == null || prop.isNode()) { throw new PathNotFoundException("Property not found " + name); } return prop; }
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); } } }