Package nl.siegmann.epublib.epub
Class EpubReader
java.lang.Object
nl.siegmann.epublib.epub.EpubReader
Reads an epub file.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate StringgetPackageResourceHref(Resources resources) private voidhandleMimeType(Book result, Resources resources) private BookpostProcessBook(Book book) private ResourceprocessNcxResource(Resource packageResource, Book book) private ResourceprocessPackageResource(String packageResourceHref, Book book, Resources resources) readEpub(InputStream in) readEpub(InputStream in, String encoding) Read epub from inputstreamreadEpub(ZipInputStream in, String encoding) readEpubLazy(ZipFile zipFile, String encoding) Reads this EPUB without loading any resources into memory.readEpubLazy(ZipFile zipFile, String encoding, List<MediaType> lazyLoadedTypes) Reads this EPUB without loading all resources into memory.
-
Field Details
-
log
private static final org.slf4j.Logger log -
bookProcessor
-
-
Constructor Details
-
EpubReader
public EpubReader()
-
-
Method Details
-
readEpub
- Throws:
IOException
-
readEpub
- Throws:
IOException
-
readEpub
- Throws:
IOException
-
readEpub
Read epub from inputstream- Parameters:
in- the inputstream from which to read the epubencoding- the encoding to use for the html files within the epub- Returns:
- the Book as read from the inputstream
- Throws:
IOException
-
readEpubLazy
Reads this EPUB without loading any resources into memory.- Parameters:
zipFile- the file to loadencoding- the encoding for XHTML files- Returns:
- this Book without loading all resources into memory.
- Throws:
IOException
-
readEpub
- Throws:
IOException
-
readEpub
- Throws:
IOException
-
readEpubLazy
public Book readEpubLazy(ZipFile zipFile, String encoding, List<MediaType> lazyLoadedTypes) throws IOException Reads this EPUB without loading all resources into memory.- Parameters:
zipFile- the file to loadencoding- the encoding for XHTML fileslazyLoadedTypes- a list of the MediaType to load lazily- Returns:
- this Book without loading all resources into memory.
- Throws:
IOException
-
readEpub
- Throws:
IOException
-
readEpub
- Throws:
IOException
-
postProcessBook
-
processNcxResource
-
processPackageResource
-
getPackageResourceHref
-
handleMimeType
-