public void validate(String fileName, Reader tensorData) {
        if (fileName.endsWith(".json")) {
            validateTensor(tensorData);
        }
        else if (fileName.endsWith(".json.lz4")) {
            // don't validate; the cost probably outweights the advantage
        }
        else if (fileName.endsWith(".tbf")) {
            // don't validate; internal format, so this constant is written by us
        }
        else {
            // (don't mention the internal format to users)
            throw new IllegalArgumentException("Ranking constant file names must end with either '.json' or '.json.lz4'");
        }
    }
ConstantTensorJsonValidator strictly validates a constant tensor in JSON format read from a Reader object

@author Vegard Sjonfjell
@author arnej
config-model/src/main/java/com/yahoo/vespa/model/application/validation/ConstantTensorJsonValidator.java