code: private boolean mkdirs(FTPClient client, Path file, FsPermission permission)
        throws IOException {
      boolean created = true;
      Path workDir = new Path(client.printWorkingDirectory());
      Path absolute = makeAbsolute(workDir, file);
      String pathName = absolute.getName();
      if (!exists(client, absolute)) {
        Path parent = absolute.getParent();
        created = (parent == null || mkdirs(client, parent, FsPermission
            .getDefault()));
        if (created) {
          String parentDir = parent.toUri().getPath();
          client.changeWorkingDirectory(parentDir);
          created = created & client.makeDirectory(pathName);
        }
      } else if (isFile(client, absolute)) {
        throw new IOException(String.format(
            "Can't make directory for path %s since it is a file.", absolute));
      }
      return created;
    }
docs: Convenience method, so that we don't open a new connection when using this
  method from within another method. Otherwise every API invocation incurs
  the overhead of opening/closing a TCP connection.