code: public static boolean mkdirs(FileSystem fs, Path dir, FsPermission permission)
    throws IOException {
      // create the directory using the default permission
      boolean result = fs.mkdirs(dir);
      // set its permission to be the supplied one
      fs.setPermission(dir, permission);
      return result;
    }
docs: create a directory with the provided permission
  The permission of the directory is set to be the provided permission as in
  setPermission, not permission&~umask
  
  @see #create(FileSystem, Path, FsPermission)
  
  @param fs file system handle
  @param dir the name of the directory to be created
  @param permission the permission of the directory
  @return true if the directory creation succeeds; false otherwise
  @throws IOException