code: static void mkdirp(ZooKeeper zookeeper, String znode) throws KeeperException, InterruptedException {
          boolean createPath = false;
          for (String path : pathParts(znode)) {
              if (!createPath) {
                  Stat stat = zookeeper.exists(path, false);
                  if (stat == null) {
                      createPath = true;
                  }
              }
              if (createPath) {
                  create(zookeeper, path);
              }
          }
      }
docs: Recursively create empty znodes (if missing) analogous to {@code mkdir -p}.
  
  @param zookeeper ZooKeeper instance to work with.
  @param znode     Path to create.
  @throws org.apache.zookeeper.KeeperException
  @throws InterruptedException