/** * Checks whether a node with the given absolute path exists. * * @see Session#nodeExists(String) * @param absPath absolute path * @return <code>true</code> if a node with the given path exists, * <code>false</code> otherwise * @throws RepositoryException if the path is invalid */ public boolean nodeExists(String absPath) throws RepositoryException { if (absPath.equals("/")) { return true; } else { return getRootNode().hasNode(toRelativePath(absPath)); } }
/** * Checks whether a property with the given absolute path exists. * * @see Session#propertyExists(String) * @param absPath absolute path * @return <code>true</code> if a property with the given path exists, * <code>false</code> otherwise * @throws RepositoryException if the path is invalid */ public boolean propertyExists(String absPath) throws RepositoryException { if (absPath.equals("/")) { return false; } else { return getRootNode().hasProperty(toRelativePath(absPath)); } }
/** * Checks whether a property with the given absolute path exists. * * @see Session#propertyExists(String) * @param absPath absolute path * @return <code>true</code> if a property with the given path exists, * <code>false</code> otherwise * @throws RepositoryException if the path is invalid */ public boolean propertyExists(String absPath) throws RepositoryException { if (absPath.equals("/")) { return false; } else { return getRootNode().hasProperty(toRelativePath(absPath)); } }
/** * Returns the node with the given absolute path. * * @see Session#getNode(String) * @param absPath absolute path * @return node at the given path * @throws RepositoryException if the node can not be accessed */ public Node getNode(String absPath) throws RepositoryException { Node root = getRootNode(); if (absPath.equals("/")) { return root; } else { return root.getNode(toRelativePath(absPath)); } }
/** * Checks whether a node with the given absolute path exists. * * @see Session#nodeExists(String) * @param absPath absolute path * @return <code>true</code> if a node with the given path exists, * <code>false</code> otherwise * @throws RepositoryException if the path is invalid */ public boolean nodeExists(String absPath) throws RepositoryException { if (absPath.equals("/")) { return true; } else { return getRootNode().hasNode(toRelativePath(absPath)); } }
/** * Checks whether a node with the given absolute path exists. * * @see Session#nodeExists(String) * @param absPath absolute path * @return <code>true</code> if a node with the given path exists, * <code>false</code> otherwise * @throws RepositoryException if the path is invalid */ public boolean nodeExists(String absPath) throws RepositoryException { if (absPath.equals("/")) { return true; } else { return getRootNode().hasNode(toRelativePath(absPath)); } }
/** * Checks whether a property with the given absolute path exists. * * @see Session#propertyExists(String) * @param absPath absolute path * @return <code>true</code> if a property with the given path exists, * <code>false</code> otherwise * @throws RepositoryException if the path is invalid */ public boolean propertyExists(String absPath) throws RepositoryException { if (absPath.equals("/")) { return false; } else { return getRootNode().hasProperty(toRelativePath(absPath)); } }
/** * Returns the node with the given absolute path. * * @see Session#getNode(String) * @param absPath absolute path * @return node at the given path * @throws RepositoryException if the node can not be accessed */ public Node getNode(String absPath) throws RepositoryException { Node root = getRootNode(); if (absPath.equals("/")) { return root; } else { return root.getNode(toRelativePath(absPath)); } }
/** * Returns the node with the given absolute path. * * @see Session#getNode(String) * @param absPath absolute path * @return node at the given path * @throws RepositoryException if the node can not be accessed */ public Node getNode(String absPath) throws RepositoryException { Node root = getRootNode(); if (absPath.equals("/")) { return root; } else { return root.getNode(toRelativePath(absPath)); } }
/** * Calls {@link #getItem(String)} with the given path and returns * <code>true</code> if the call succeeds. Returns <code>false</code> * if a {@link PathNotFoundException} was thrown. Other exceptions are * passed through. * * @see Session#itemExists(String) * @param absPath absolute path * @return <code>true</code> if an item exists at the given path, * <code>false</code> otherwise * @throws RepositoryException if an error occurs */ public boolean itemExists(String absPath) throws RepositoryException { if (absPath.equals("/")) { return true; } else { Node root = getRootNode(); String relPath = toRelativePath(absPath); return root.hasNode(relPath) || root.hasProperty(relPath); } }
/** * Calls {@link #getItem(String)} with the given path and returns * <code>true</code> if the call succeeds. Returns <code>false</code> * if a {@link PathNotFoundException} was thrown. Other exceptions are * passed through. * * @see Session#itemExists(String) * @param absPath absolute path * @return <code>true</code> if an item exists at the given path, * <code>false</code> otherwise * @throws RepositoryException if an error occurs */ public boolean itemExists(String absPath) throws RepositoryException { if (absPath.equals("/")) { return true; } else { Node root = getRootNode(); String relPath = toRelativePath(absPath); return root.hasNode(relPath) || root.hasProperty(relPath); } }
/** * Calls {@link #getItem(String)} with the given path and returns * <code>true</code> if the call succeeds. Returns <code>false</code> * if a {@link PathNotFoundException} was thrown. Other exceptions are * passed through. * * @see Session#itemExists(String) * @param absPath absolute path * @return <code>true</code> if an item exists at the given path, * <code>false</code> otherwise * @throws RepositoryException if an error occurs */ public boolean itemExists(String absPath) throws RepositoryException { if (absPath.equals("/")) { return true; } else { Node root = getRootNode(); String relPath = toRelativePath(absPath); return root.hasNode(relPath) || root.hasProperty(relPath); } }
/** * Returns the property with the given absolute path. * * @see Session#getProperty(String) * @param absPath absolute path * @return node at the given path * @throws RepositoryException if the property can not be accessed */ public Property getProperty(String absPath) throws RepositoryException { if (absPath.equals("/")) { throw new RepositoryException("The root node is not a property"); } else { return getRootNode().getProperty(toRelativePath(absPath)); } }
/** * Returns the property with the given absolute path. * * @see Session#getProperty(String) * @param absPath absolute path * @return node at the given path * @throws RepositoryException if the property can not be accessed */ public Property getProperty(String absPath) throws RepositoryException { if (absPath.equals("/")) { throw new RepositoryException("The root node is not a property"); } else { return getRootNode().getProperty(toRelativePath(absPath)); } }
/** * Returns the property with the given absolute path. * * @see Session#getProperty(String) * @param absPath absolute path * @return node at the given path * @throws RepositoryException if the property can not be accessed */ public Property getProperty(String absPath) throws RepositoryException { if (absPath.equals("/")) { throw new RepositoryException("The root node is not a property"); } else { return getRootNode().getProperty(toRelativePath(absPath)); } }
return getNodeByIdentifier(absPath.substring(1, absPath.length() - 1)); } else { String relPath = toRelativePath(absPath); if (root.hasNode(relPath)) { return root.getNode(relPath);
return getNodeByIdentifier(absPath.substring(1, absPath.length() - 1)); } else { String relPath = toRelativePath(absPath); if (root.hasNode(relPath)) { return root.getNode(relPath);
return getNodeByIdentifier(absPath.substring(1, absPath.length() - 1)); } else { String relPath = toRelativePath(absPath); if (root.hasNode(relPath)) { return root.getNode(relPath);