Class EpubWriter
java.lang.Object
nl.siegmann.epublib.epub.EpubWriter
Generates an epub file. Not thread-safe, single use object.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate BookProcessor(package private) static final Stringprivate static final org.slf4j.Logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate longcalculateCrc(byte[] data) (package private) String(package private) StringgetNcxId()(package private) Stringprivate voidinitTOCResource(Book book) private BookprocessBook(Book book) voidsetBookProcessor(BookProcessor bookProcessor) voidwrite(Book book, OutputStream out) private voidwriteContainer(ZipOutputStream resultStream) Writes the META-INF/container.xml file.private voidwriteMimeType(ZipOutputStream resultStream) Stores the mimetype as an uncompressed file in the ZipOutputStream.private voidwritePackageDocument(Book book, ZipOutputStream resultStream) private voidwriteResource(Resource resource, ZipOutputStream resultStream) Writes the resource to the resultStream.private voidwriteResources(Book book, ZipOutputStream resultStream)
-
Field Details
-
log
private static final org.slf4j.Logger log -
EMPTY_NAMESPACE_PREFIX
- See Also:
-
bookProcessor
-
-
Constructor Details
-
EpubWriter
public EpubWriter() -
EpubWriter
-
-
Method Details
-
write
- Throws:
IOException
-
processBook
-
initTOCResource
-
writeResources
- Throws:
IOException
-
writeResource
Writes the resource to the resultStream.- Parameters:
resource-resultStream-- Throws:
IOException
-
writePackageDocument
- Throws:
IOException
-
writeContainer
Writes the META-INF/container.xml file.- Parameters:
resultStream-- Throws:
IOException
-
writeMimeType
Stores the mimetype as an uncompressed file in the ZipOutputStream.- Parameters:
resultStream-- Throws:
IOException
-
calculateCrc
private long calculateCrc(byte[] data) -
getNcxId
String getNcxId() -
getNcxHref
String getNcxHref() -
getNcxMediaType
String getNcxMediaType() -
getBookProcessor
-
setBookProcessor
-