code: static Set<PosixFilePermission> getPosixFilePermissions(int mode) {
      Set<PosixFilePermission> result = EnumSet.noneOf(PosixFilePermission.class);
  
      if ((mode & 0400) != 0) {
        result.add(PosixFilePermission.OWNER_READ);
      }
      if ((mode & 0200) != 0) {
        result.add(PosixFilePermission.OWNER_WRITE);
      }
      if ((mode & 0100) != 0) {
        result.add(PosixFilePermission.OWNER_EXECUTE);
      }
      if ((mode & 040) != 0) {
        result.add(PosixFilePermission.GROUP_READ);
      }
      if ((mode & 020) != 0) {
        result.add(PosixFilePermission.GROUP_WRITE);
      }
      if ((mode & 010) != 0) {
        result.add(PosixFilePermission.GROUP_EXECUTE);
      }
      if ((mode & 04) != 0) {
        result.add(PosixFilePermission.OTHERS_READ);
      }
      if ((mode & 02) != 0) {
        result.add(PosixFilePermission.OTHERS_WRITE);
      }
      if ((mode & 01) != 0) {
        result.add(PosixFilePermission.OTHERS_EXECUTE);
      }
      return result;
    }
docs: Convert integer mode to {@link PosixFilePermission} object.