private void validate(Reader reader, String fileName) throws IOException {
        errorHandler.fileName = (fileName == null ? "input" : fileName);
        // We need to read from a reader in error handler, so need to read all content into a new one
        Reader newReader = new StringReader(IOUtils.readAll(reader));
        errorHandler.reader = newReader;
        try {
            if ( ! driver.validate(new InputSource(newReader))) {
                // Shouldn't happen, error handler should have thrown
                throw new RuntimeException("Aborting due to earlier XML errors.");
            }
        } catch (SAXException e) {
            // Shouldn't happen, error handler should have thrown
            throw new IllegalArgumentException("XML error in " + errorHandler.fileName + ": " + Exceptions.toMessageString(e));
        }
    }
Initializes the validator by using the given file as schema file

@param schemaFile schema file
@throws IOException if it is not possible to read schema files
config-application-package/src/main/java/com/yahoo/config/model/application/provider/SchemaValidator.java