I'm creating EPUB files from an application, using ZipOutputStream. When I look at the resulting zip file with Winzip, it seems to be OK, except that in addition to the files and folders I expect, there is an additional folder which should not be there and does not appear in the log output by the code.
My folder structure to be zipped is the same as the IBM Developerworks "Getting Started with EPUB" tutorial. Before I started all this, I created an epub according to the tutorial instructions using WinZip and it extracts correctly, and works correctly in Adobe Digital Editions 2.0.
c:
/myepub
/epub
mimetype
/META-INF
container.xml
/OEBPS
content.html
content.opf
stylesheet.css
title.html
toc.ncx
/images
cover.png
My Java class (194 lines) creates the zip using the relative part of each name, and the result contains everything that the WinZip-created version has, i.e. it looks like the structure above below the /epub folder.
My code log:
mimetype
META-INF/container.xml
OEBPS/content.html
OEBPS/content.opf
OEBPS/images/cover.png
OEBPS/stylesheet.css
OEBPS/title.html
OEBPS/toc.ncx
But in addition there is:
/myepub
/epub
/OEBPS
images
Note that images
here is not a folder, it is a zero-length file.
When I try to extract this with WinZip, it fails with:
Extracting to "C:\myepub\extract\"
Use Path: yes Overlay Files: no
Extracting OEBPS
C:\myepub\extract\OEBPS exists but is not directory
unable to process C:\myepub\extract\OEBPS\images.
I must be missing something very fundamental here. Can anyone point me in the right direction?