Package nl.siegmann.epublib.epub
Class EpubReader
- java.lang.Object
-
- nl.siegmann.epublib.epub.EpubReader
-
public class EpubReader extends java.lang.ObjectReads an epub file.
-
-
Field Summary
Fields Modifier and Type Field Description private BookProcessorbookProcessorprivate static org.slf4j.Loggerlog
-
Constructor Summary
Constructors Constructor Description EpubReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.StringgetPackageResourceHref(Resources resources)private voidhandleMimeType(Book result, Resources resources)private BookpostProcessBook(Book book)private ResourceprocessNcxResource(Resource packageResource, Book book)private ResourceprocessPackageResource(java.lang.String packageResourceHref, Book book, Resources resources)BookreadEpub(java.io.InputStream in)BookreadEpub(java.io.InputStream in, java.lang.String encoding)Read epub from inputstreamBookreadEpub(ZipFile zipfile)BookreadEpub(ZipFile in, java.lang.String encoding)BookreadEpub(ZipInputStream in)BookreadEpub(ZipInputStream in, java.lang.String encoding)BookreadEpub(Resources resources)BookreadEpub(Resources resources, Book result)BookreadEpubLazy(ZipFile zipFile, java.lang.String encoding)Reads this EPUB without loading any resources into memory.BookreadEpubLazy(ZipFile zipFile, java.lang.String encoding, java.util.List<MediaType> lazyLoadedTypes)Reads this EPUB without loading all resources into memory.
-
-
-
Field Detail
-
log
private static final org.slf4j.Logger log
-
bookProcessor
private BookProcessor bookProcessor
-
-
Method Detail
-
readEpub
public Book readEpub(java.io.InputStream in) throws java.io.IOException
- Throws:
java.io.IOException
-
readEpub
public Book readEpub(ZipInputStream in) throws java.io.IOException
- Throws:
java.io.IOException
-
readEpub
public Book readEpub(ZipFile zipfile) throws java.io.IOException
- Throws:
java.io.IOException
-
readEpub
public Book readEpub(java.io.InputStream in, java.lang.String encoding) throws java.io.IOException
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:
java.io.IOException
-
readEpubLazy
public Book readEpubLazy(ZipFile zipFile, java.lang.String encoding) throws java.io.IOException
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:
java.io.IOException
-
readEpub
public Book readEpub(ZipInputStream in, java.lang.String encoding) throws java.io.IOException
- Throws:
java.io.IOException
-
readEpub
public Book readEpub(ZipFile in, java.lang.String encoding) throws java.io.IOException
- Throws:
java.io.IOException
-
readEpubLazy
public Book readEpubLazy(ZipFile zipFile, java.lang.String encoding, java.util.List<MediaType> lazyLoadedTypes) throws java.io.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:
java.io.IOException
-
readEpub
public Book readEpub(Resources resources) throws java.io.IOException
- Throws:
java.io.IOException
-
readEpub
public Book readEpub(Resources resources, Book result) throws java.io.IOException
- Throws:
java.io.IOException
-
processPackageResource
private Resource processPackageResource(java.lang.String packageResourceHref, Book book, Resources resources)
-
getPackageResourceHref
private java.lang.String getPackageResourceHref(Resources resources)
-
-