Package javax.jcr

Examples of javax.jcr.PathNotFoundException


        // report specific validation: resource must represent an existing
        // repository node
        absNodePath = resource.getLocator().getRepositoryPath();
        try {
            if (!(getRepositorySession().itemExists(absNodePath) && getRepositorySession().getItem(absNodePath).isNode())) {
                throw new JcrDavException(new PathNotFoundException(absNodePath + " does not exist."));
            }
        } catch (RepositoryException e) {
            throw new JcrDavException(e);
        }
View Full Code Here


            String workspaceName = rLoc.getFactory().createResourceLocator(rLoc.getPrefix(), workspaceHref).getWorkspaceName();
            String corrPath = ((Node)item).getCorrespondingNodePath(workspaceName);
            DavResourceLocator corrLoc = rLoc.getFactory().createResourceLocator(rLoc.getPrefix(), "/" + workspaceName, corrPath, false);
            return corrLoc.getHref(true);
        } else {
            throw new PathNotFoundException("Node with path " + itemPath + " does not exist.");
        }
    }
View Full Code Here

                return itemMgr.getNode(qPath);
            } else {
                return itemMgr.getProperty(qPath);
            }
        } catch (AccessDeniedException ade) {
            throw new PathNotFoundException(absPath);
        }
    }
View Full Code Here

        try {
            Path qPath = getQPath(absPath).getNormalizedPath();
            ItemManager itemMgr = getItemManager();
            return itemMgr.getNode(qPath);
        } catch (AccessDeniedException ade) {
            throw new PathNotFoundException(absPath);
        }
    }
View Full Code Here

        try {
            Path qPath = getQPath(absPath).getNormalizedPath();
            ItemManager itemMgr = getItemManager();
            return itemMgr.getProperty(qPath);
        } catch (AccessDeniedException ade) {
            throw new PathNotFoundException(absPath);
        }
    }
View Full Code Here

                            }
                            degree++;
                        }
                    }
                    if (n == null) {
                        throw new PathNotFoundException("Path not found " + nodeId);
                    } else {
                        n.restore(v, sInfo.getNamePathResolver().getJCRPath(relPath), removeExisting);
                    }
                }
                return null;
View Full Code Here

            }
            else {
                return new MockProperty(itemData, this);
            }
        } else {
            throw new PathNotFoundException(String.format("No item found at: %s.", absPath));
        }
    }
View Full Code Here

    public Node getNode(final String absPath) throws RepositoryException {
        Item item = getItem(absPath);
        if (item instanceof Node) {
            return (Node) item;
        } else {
            throw new PathNotFoundException(String.format("No node found at: %s.", absPath));
        }
    }
View Full Code Here

    public Property getProperty(final String absPath) throws RepositoryException {
        Item item = getItem(absPath);
        if (item instanceof Property) {
            return (Property) item;
        } else {
            throw new PathNotFoundException(String.format("No property found at: %s.", absPath));
        }
    }
View Full Code Here

                    Resource resource = resourceResolver.getResource(nodePath);
                    if (resource!=null) {
                        ValueMap props = resource.adaptTo(ValueMap.class);
                        Object value = props.get(propertyName);
                        if (value==null) {
                            throw new PathNotFoundException();
                        }
                        Property prop = mock(Property.class);
                        when(prop.getName()).thenReturn(propertyName);
                        if (value instanceof String) {
                            when(prop.getString()).thenReturn((String)value);
                        }
                        else if (value instanceof Boolean) {
                            when(prop.getBoolean()).thenReturn((Boolean)value);
                        }
                        return prop;
                    }
                    else {
                        throw new PathNotFoundException();
                    }
                }
            });
        }
        catch (RepositoryException ex) {
View Full Code Here

TOP

Related Classes of javax.jcr.PathNotFoundException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.