use of org.springframework.core.io.ResourceLoader in project webapp by elimu-ai.
the class EPubChapterExtractionHelperTest method testExtractChapterReferencesFromTableOfContentsFile_LETS_READ_ASIA.
@Test
public void testExtractChapterReferencesFromTableOfContentsFile_LETS_READ_ASIA() throws IOException {
ResourceLoader resourceLoader = new ClassRelativeResourceLoader(EPubChapterExtractionHelper.class);
Resource resource = resourceLoader.getResource("fil-lra-0acfe340-6116-4f8a-a45d-c925c8a1fd0e.epub_toc.xhtml");
File xhtmlFile = resource.getFile();
logger.debug("xhtmlFile: " + xhtmlFile);
List<String> chapterReferences = EPubChapterExtractionHelper.extractChapterReferencesFromTableOfContentsFile(xhtmlFile);
assertThat(chapterReferences.size(), is(12));
}
use of org.springframework.core.io.ResourceLoader in project webapp by elimu-ai.
the class EPubMetadataExtractionHelperTest method testExtractCoverImageReferenceFromOpfFile_BEN_STORYWEAVER_11791.
@Test
public void testExtractCoverImageReferenceFromOpfFile_BEN_STORYWEAVER_11791() throws IOException {
ResourceLoader resourceLoader = new ClassRelativeResourceLoader(EPubMetadataExtractionHelper.class);
Resource resource = resourceLoader.getResource("ben-sw-11791-ghumkature-bhim.epub_package.opf");
File opfFile = resource.getFile();
logger.debug("opfFile: " + opfFile);
String coverImageReference = EPubMetadataExtractionHelper.extractCoverImageReferenceFromOpfFile(opfFile);
assertThat(coverImageReference, is("image_1.jpg"));
}
use of org.springframework.core.io.ResourceLoader in project webapp by elimu-ai.
the class EPubMetadataExtractionHelperTest method testExtractTitleFromOpfFile_BEN_STORYWEAVER_11791.
@Test
public void testExtractTitleFromOpfFile_BEN_STORYWEAVER_11791() throws IOException {
ResourceLoader resourceLoader = new ClassRelativeResourceLoader(EPubMetadataExtractionHelper.class);
Resource resource = resourceLoader.getResource("ben-sw-11791-ghumkature-bhim.epub_package.opf");
File opfFile = resource.getFile();
logger.debug("opfFile: " + opfFile);
String title = EPubMetadataExtractionHelper.extractTitleFromOpfFile(opfFile);
assertThat(title, is("ঘুমকাতুরে ভীম"));
String description = EPubMetadataExtractionHelper.extractDescriptionFromOpfFile(opfFile);
assertThat(description, is(nullValue()));
}
use of org.springframework.core.io.ResourceLoader in project webapp by elimu-ai.
the class EPubMetadataExtractionHelperTest method testExtractCoverImageReferenceFromOpfFile_FIL_GLOBAL_DIGITAL_LIBRARY_761.
@Test
public void testExtractCoverImageReferenceFromOpfFile_FIL_GLOBAL_DIGITAL_LIBRARY_761() throws IOException {
ResourceLoader resourceLoader = new ClassRelativeResourceLoader(EPubMetadataExtractionHelper.class);
Resource resource = resourceLoader.getResource("ben-gdl-761.epub_book.opf");
File opfFile = resource.getFile();
logger.debug("opfFile: " + opfFile);
String coverImageReference = EPubMetadataExtractionHelper.extractCoverImageReferenceFromOpfFile(opfFile);
assertThat(coverImageReference, is("99e3d3af620881991813482fb602a1f6.jpg"));
}
use of org.springframework.core.io.ResourceLoader in project webapp by elimu-ai.
the class EPubMetadataExtractionHelperTest method testExtractCoverImageReferenceFromOpfFile_FIL_LETS_READ_ASIA_0acfe340.
@Test
public void testExtractCoverImageReferenceFromOpfFile_FIL_LETS_READ_ASIA_0acfe340() throws IOException {
ResourceLoader resourceLoader = new ClassRelativeResourceLoader(EPubMetadataExtractionHelper.class);
Resource resource = resourceLoader.getResource("fil-lra-0acfe340-6116-4f8a-a45d-c925c8a1fd0e.epub_content.opf");
File opfFile = resource.getFile();
logger.debug("opfFile: " + opfFile);
String coverImageReference = EPubMetadataExtractionHelper.extractCoverImageReferenceFromOpfFile(opfFile);
assertThat(coverImageReference, is("coverImage.jpeg"));
}
Aggregations