code: public static void mkdirIfNotExists(UnderFileSystem ufs, String path) throws IOException {
      if (!ufs.isDirectory(path)) {
        if (!ufs.mkdirs(path)) {
          throw new IOException("Failed to make folder: " + path);
        }
      }
    }
docs: Attempts to create the directory if it does not already exist.
  
  @param ufs instance of {@link UnderFileSystem}
  @param path path to the directory