code: public String getParent(CmsWorkplace wp, String toolPath) {
  
          if (toolPath.equals(getBaseToolPath(wp))) {
              return toolPath;
          }
          int pos = toolPath.lastIndexOf(TOOLPATH_SEPARATOR);
          return pos <= 0 ? TOOLPATH_SEPARATOR : toolPath.substring(0, pos);
      }
docs: Returns the path to the parent of the tool identified by the given tool path.<p>
  
  The parent of the root is the same root.<p>
  
  @param wp the workplace object
  @param toolPath the abstract tool path
  
  @return his parent