private void validateContent()

in src/main/java/com/epam/digital/data/platform/kafkaapi/core/service/AbstractCsvProcessor.java [55:64]


    private void validateContent(byte[] content) {
        log.info("Validating csv file content");
        CharsetDetector charsetDetector = new CharsetDetector(content.length);
        charsetDetector.setText(content);
        var encoding = charsetDetector.detectAll()[0].getName();
        if (!StringUtils.equals(encoding, StandardCharsets.UTF_8.name())) {
            throw new CsvFileEncodingException(
                    "Wrong csv file encoding found instead of UTF-8: " + encoding);
        }
    }