class MetricFrameLoader {

    public static MetricFrame loadCsv(File metricDefFile, File metricDataFile, boolean hasHeader)
            throws IOException {

        val metricDef = OBJECT_MAPPER.readValue(metricDefFile, MetricDefinition.class);

        //SAST SCAN. Unreleased Resource. Close the file input stream. [KS]
        FileInputStream fileInputStream  = new FileInputStream(metricDataFile);
        try {
            return loadCsv(metricDef, fileInputStream, hasHeader);
        } finally {
            if (fileInputStream != null) {
                safeClose(fileInputStream);
            }
        }
    }

}