code: private static LinuxRelease parseLinuxRedhatReleaseFile(File file) {
          BufferedReader reader = null;
          try {
              reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), "utf-8"));
  
              // There is only a single line in this file.
              String line = reader.readLine();
              if (line != null) {
                  line = line.toLowerCase(Locale.US);
  
                  String id;
                  String version = null;
                  if (line.contains("centos")) {
                      id = "centos";
                  } else if (line.contains("fedora")) {
                      id = "fedora";
                  } else if (line.contains("red hat enterprise linux")) {
                      id = "rhel";
                  } else {
                      // Other variants are not currently supported.
                      return null;
                  }
  
                  Matcher versionMatcher = REDHAT_MAJOR_VERSION_REGEX.matcher(line);
                  if (versionMatcher.find()) {
                      version = versionMatcher.group(1);
                  }
  
                  Set<String> likeSet = new LinkedHashSet<String>();
                  likeSet.addAll(Arrays.asList(DEFAULT_REDHAT_VARIANTS));
                  likeSet.add(id);
  
                  return new LinuxRelease(id, version, likeSet);
              }
          } catch (IOException ignored) {
              // Just absorb. Don't treat failure to read /etc/os-release as an error.
          } finally {
              closeQuietly(reader);
          }
          return null;
      }
docs: Parses the {@code /etc/redhat-release} and returns a {@link LinuxRelease} containing the
  ID and like ["rhel", "fedora", ID]. Currently only supported for CentOS, Fedora, and RHEL.
  Other variants will return {@code null}.