Book result = new Book();
List<TOCReference> sections = new ArrayList<TOCReference>();
Resources resources = new Resources();
processDirectory(rootDirectory, rootDirectory, sections, resources, encoding);
result.setResources(resources);
TableOfContents tableOfContents = new TableOfContents(sections);
result.setTableOfContents(tableOfContents);
result.setSpine(new Spine(tableOfContents));
result = bookProcessor.processBook(result);