public PageTemplate readFile(String fileName) {
        NamedReader pageReader = null;
        try {
            File file = new File(fileName);
            pageReader = new NamedReader(fileName,new FileReader(file));
            String firstName = file.getName().substring(0, file.getName().length() - 4);
            return read(List.of(pageReader), true).getComponent(firstName);
        }
        catch (IOException e) {
            throw new IllegalArgumentException("Could not read the page template '" + fileName + "'", e);
        }
        finally {
            if (pageReader != null)
                try { pageReader.close(); } catch (IOException e) { }
        }
    }
Reads a single page template file.

@throws RuntimeException if <code>fileName</code> is not a readable file, or if there is some error in the XML
container-search/src/main/java/com/yahoo/search/pagetemplates/config/PageTemplateXMLReader.java