/** * Returns the path of this node. * <p> * The default implementation recursively calls this method on the * parent node and appends the name and optionally the index of this * node to construct the full path. Returns "/" if the parent node is * not available (i.e. this is the root node). * * @return node path * @throws RepositoryException if an error occurs */ public String getPath() throws RepositoryException { try { StringBuffer buffer = new StringBuffer(getParent().getPath()); if (buffer.length() > 1) { buffer.append('/'); } buffer.append(getName()); int index = getIndex(); if (index != 1) { buffer.append('['); buffer.append(index); buffer.append(']'); } return buffer.toString(); } catch (ItemNotFoundException e) { return "/"; } }
/** * Returns the path of this node. * <p> * The default implementation recursively calls this method on the * parent node and appends the name and optionally the index of this * node to construct the full path. Returns "/" if the parent node is * not available (i.e. this is the root node). * * @return node path * @throws RepositoryException if an error occurs */ public String getPath() throws RepositoryException { try { StringBuffer buffer = new StringBuffer(getParent().getPath()); if (buffer.length() > 1) { buffer.append('/'); } buffer.append(getName()); int index = getIndex(); if (index != 1) { buffer.append('['); buffer.append(index); buffer.append(']'); } return buffer.toString(); } catch (ItemNotFoundException e) { return "/"; } }
/** * Returns the path of this node. * <p> * The default implementation recursively calls this method on the * parent node and appends the name and optionally the index of this * node to construct the full path. Returns "/" if the parent node is * not available (i.e. this is the root node). * * @return node path * @throws RepositoryException if an error occurs */ public String getPath() throws RepositoryException { try { StringBuffer buffer = new StringBuffer(getParent().getPath()); if (buffer.length() > 1) { buffer.append('/'); } buffer.append(getName()); int index = getIndex(); if (index != 1) { buffer.append('['); buffer.append(index); buffer.append(']'); } return buffer.toString(); } catch (ItemNotFoundException e) { return "/"; } }
/** * Returns the path of this node. * <p> * The default implementation recursively calls this method on the * parent node and appends the name and optionally the index of this * node to construct the full path. Returns "/" if the parent node is * not available (i.e. this is the root node). * * @return node path * @throws RepositoryException if an error occurs */ public String getPath() throws RepositoryException { try { StringBuffer buffer = new StringBuffer(getParent().getPath()); if (buffer.length() > 1) { buffer.append('/'); } buffer.append(getName()); int index = getIndex(); if (index != 1) { buffer.append('['); buffer.append(index); buffer.append(']'); } return buffer.toString(); } catch (ItemNotFoundException e) { return "/"; } }