Commit 6c527e51 authored by Jos van den Oever's avatar Jos van den Oever

Retain directory enties for ODF objects in the manifest.

parent 50f22d0e
......@@ -46,8 +46,12 @@ public class OdfNormalizer {
for (Attr a : XPath.attrIterator(manifest,
"/manifest:manifest/manifest:file-entry/@manifest:full-path")) {
String path = a.getNodeValue();
String mediaType = a.getOwnerElement().getAttributeNS(NC.manifest,
"media-type");
Element e = a.getOwnerElement();
if (path.equals("/")) {
if (path.endsWith("/")
&& mediaType
.startsWith("application/vnd.oasis.opendocument.")) {
continue;
} else if (done.contains(path)
|| path.endsWith("/")
......
......@@ -132,11 +132,11 @@ public class OdfZipNormalizer {
zip.closeEntry();
}
static private void normalizeEntry(ZipFile zip, ZipEntry entry,
static private void normalizeEntry(ZipFile zip, @Nullable ZipEntry entry,
ZipOutputStream out, OdfNormalizer odfNormalizer,
@Nullable StyleNames styleNames) throws IOException, SAXException,
TransformerException, NormalizeException, XMLStreamException {
if (entry.isDirectory()) {
if (entry == null || entry.isDirectory()) {
return;
}
final String name = entry.getName();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment