public static FilePermissions fromOctalString(String octalPermissions) {
    if (!octalPermissions.matches(OCTAL_PATTERN)) {
      throw new IllegalArgumentException(
          "octalPermissions must be a 3-digit octal number (000-777)");
    }
    return new FilePermissions(Integer.parseInt(octalPermissions, 8));
  }
Creates a new {@link FilePermissions} from an octal string representation (e.g. "123", "644",
"755", etc).

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