code: public static String parent(String node) {
          final int index = node.lastIndexOf('/');
          if (index < 0)
              return null;
          return node.substring(0, index);
      }
docs: Returns the parent tree node of a given node.
  @param node A tree node's full path.
  @return The full path of the given node's parent.