final File foFile = new File(this.testDirectory, file);
InputStream foInputStream;
try {
foInputStream = new FileInputStream(foFile);
} catch (final FileNotFoundException e) {
throw new FOrayException(e);
}
final InputSource foInputSource = new InputSource(foInputStream);
XMLReader xmlReader;
try {
xmlReader = SaxParser.createSax2Parser();
} catch (final SAXException e) {
throw new FOrayException(e);
} catch (final ParserConfigurationException e) {
throw new FOrayException(e);
}
final FOTreeBuilder foTree = this.treeServer.makeFoTree();
final FontServer fontServer = this.treeServer.getFontServer();
final FontConsumer fontConsumer = fontServer.makeFontConsumer();
foTree.setFontConsumer(fontConsumer);
xmlReader.setContentHandler(foTree);
try {
xmlReader.parse(foInputSource);
} catch (final IOException e) {
throw new FOrayException(e);
} catch (final SAXException e) {
throw new FOrayException(e);
}
return foTree;
}