public static FilePermissions fromPosixFilePermissions(
      Set<PosixFilePermission> posixFilePermissions) {
    int permissionBits = 0;
    for (PosixFilePermission permission : posixFilePermissions) {
      permissionBits |= Objects.requireNonNull(PERMISSION_MAP.get(permission));
    }
    return new FilePermissions(permissionBits);
  }
Creates a new {@link FilePermissions} from a set of {@link PosixFilePermission}.

@param posixFilePermissions the set of {@link PosixFilePermission}
@return a new {@link FilePermissions} with the given permissions
jib-build-plan/src/main/java/com/google/cloud/tools/jib/api/buildplan/FilePermissions.java