/** * Get the tree's path within the repository. * <p> * This method is not very efficient and is primarily meant for debugging * and final output generation. Applications should try to avoid calling it, * and if invoked do so only once per interesting entry, where the name is * absolutely required for correct function. * * @return path of the tree, relative to the repository root. If this is not * the root tree the path ends with '/'. The root tree's path string * is the empty string (""). */ public String getPathString() { final StringBuilder r = new StringBuilder(); appendName(r); return r.toString(); }
private void appendName(StringBuilder r) { if (parent != null) { parent.appendName(r); r.append(getNameString()); r.append('/'); } else if (nameLength() > 0) { r.append(getNameString()); r.append('/'); } }
/** * Get the tree's path within the repository. * <p> * This method is not very efficient and is primarily meant for debugging * and final output generation. Applications should try to avoid calling it, * and if invoked do so only once per interesting entry, where the name is * absolutely required for correct function. * * @return path of the tree, relative to the repository root. If this is not * the root tree the path ends with '/'. The root tree's path string * is the empty string (""). */ public String getPathString() { final StringBuilder r = new StringBuilder(); appendName(r); return r.toString(); }
/** * Get the tree's path within the repository. * <p> * This method is not very efficient and is primarily meant for debugging * and final output generation. Applications should try to avoid calling it, * and if invoked do so only once per interesting entry, where the name is * absolutely required for correct function. * * @return path of the tree, relative to the repository root. If this is not * the root tree the path ends with '/'. The root tree's path string * is the empty string (""). */ public String getPathString() { final StringBuilder r = new StringBuilder(); appendName(r); return r.toString(); }
private void appendName(final StringBuilder r) { if (parent != null) { parent.appendName(r); r.append(getNameString()); r.append('/'); } else if (nameLength() > 0) { r.append(getNameString()); r.append('/'); } }
private void appendName(StringBuilder r) { if (parent != null) { parent.appendName(r); r.append(getNameString()); r.append('/'); } else if (nameLength() > 0) { r.append(getNameString()); r.append('/'); } }