PackageDocumentReader extends PackageDocumentBase { static Set<String> findCoverHrefs(Document packageDocument) { Set<String> result = new HashSet<String>(); String coverResourceId = DOMUtil.getFindAttributeValue(packageDocument, NAMESPACE_OPF, OPFTags.meta, OPFAttributes.name, OPFValues.meta_cover, OPFAttributes.content); if (StringUtil.isNotBlank(coverResourceId)) { String coverHref = DOMUtil.getFindAttributeValue(packageDocument, NAMESPACE_OPF, OPFTags.item, OPFAttributes.id, coverResourceId, OPFAttributes.href); if (StringUtil.isNotBlank(coverHref)) { result.add(coverHref); } else { result.add(coverResourceId); } } String coverHref = DOMUtil.getFindAttributeValue(packageDocument, NAMESPACE_OPF, OPFTags.reference, OPFAttributes.type, OPFValues.reference_cover, OPFAttributes.href); if (StringUtil.isNotBlank(coverHref)) { result.add(coverHref); } return result; }  static void read(Resource packageResource, EpubReader epubReader, Book book, Resources resources);  }
@Test public void testFindCoverHref_content1() throws SAXException, IOException { Document packageDocument; packageDocument = EpubProcessorSupport.createDocumentBuilder().parse(PackageDocumentReaderTest.class.getResourceAsStream("/opf/test1.opf")); Collection<String> coverHrefs = PackageDocumentReader.findCoverHrefs(packageDocument); assertEquals(1, coverHrefs.size()); assertEquals("cover.html", coverHrefs.iterator().next()); }