class ZKTools {

    public static void deleteTree(ZooKeeper zk, String path) throws Exception {
        String[] list = getTree(zk, path);
        for (int i = list.length - 1; i >= 0; i--) {
            zk.delete(list[i], -1);
        }
    }

}