All pastes #447048 Raw Edit

Stuff

public text v1 · immutable
·published 2007-04-18 20:18 UTC
rendered paste body
	/**
	 * Return the path of the parent container of the supplied path.
	 * @param path The fully qualified path for which to effectivly return path length - 1.
	 * @return A String that is the parent path for the fully qualified path target.
	 * (e.g. /a/b/c -> /a/b)
	 */
    public String getParentPath(String path) {
		String[] paths = path.split("/");
		String parent_path = null;
		for(int i = 1; i < paths.length -1; i++)
			parent_path += "/" + paths[i];
		return parent_path;
    }