/** * 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. * * @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 { try { getItem(absPath); return true; } catch (PathNotFoundException e) { return false; } }
/** * Removes the identified item. Implemented by calling * {@link Item#remove()} on the item removed by {@link #getItem(String)}. * * @see Session#removeItem(String) * @param absPath An absolute path of the item to be removed * @throws RepositoryException if the item can not be removed */ public void removeItem(String absPath) throws RepositoryException { getItem(absPath).remove(); }
/** * Removes the identified item. Implemented by calling * {@link Item#remove()} on the item removed by {@link #getItem(String)}. * * @see Session#removeItem(String) * @param absPath An absolute path of the item to be removed * @throws RepositoryException if the item can not be removed */ public void removeItem(String absPath) throws RepositoryException { getItem(absPath).remove(); }
/** * Removes the identified item. Implemented by calling * {@link Item#remove()} on the item removed by {@link #getItem(String)}. * * @see Session#removeItem(String) * @param absPath An absolute path of the item to be removed * @throws RepositoryException if the item can not be removed */ public void removeItem(String absPath) throws RepositoryException { getItem(absPath).remove(); }
/** * Exports content at the given path using the given exporter. * * @param path of the node to be exported * @param exporter document or system view exporter * @throws SAXException if the SAX event handler failed * @throws RepositoryException if another error occurs */ private synchronized 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); } }
/** * Exports content at the given path using the given exporter. * * @param path of the node to be exported * @param exporter document or system view exporter * @throws SAXException if the SAX event handler failed * @throws RepositoryException if another error occurs */ private synchronized 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); } }
/** * Exports content at the given path using the given exporter. * * @param path of the node to be exported * @param exporter document or system view exporter * @throws SAXException if the SAX event handler failed * @throws RepositoryException if another error occurs */ private synchronized 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); } }