aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/zwobble/mammoth/docx/ZippedDocxFile.java
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-02-13 22:38:53 +0000
committerMichael Williamson <mike@zwobble.org>2016-02-13 22:38:53 +0000
commit8d01886d494d8251c0825ca7d6df214d19415325 (patch)
tree4a6755fff27f997c815418dabba20840aafd2322 /src/main/java/org/zwobble/mammoth/docx/ZippedDocxFile.java
parent6ae918357de9c9ff0b84e70016ea08aefeb48dea (diff)
Read v:imagedata
Diffstat (limited to 'src/main/java/org/zwobble/mammoth/docx/ZippedDocxFile.java')
-rw-r--r--src/main/java/org/zwobble/mammoth/docx/ZippedDocxFile.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/main/java/org/zwobble/mammoth/docx/ZippedDocxFile.java b/src/main/java/org/zwobble/mammoth/docx/ZippedDocxFile.java
new file mode 100644
index 0000000..6b8528a
--- /dev/null
+++ b/src/main/java/org/zwobble/mammoth/docx/ZippedDocxFile.java
@@ -0,0 +1,25 @@
+package org.zwobble.mammoth.docx;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+public class ZippedDocxFile implements DocxFile {
+ private final ZipFile zipFile;
+
+ public ZippedDocxFile(ZipFile zipFile) {
+ this.zipFile = zipFile;
+ }
+
+ @Override
+ public InputStream getInputStream(String name) throws IOException {
+ ZipEntry entry = zipFile.getEntry("word/document.xml");
+ return zipFile.getInputStream(entry);
+ }
+
+ @Override
+ public void close() throws IOException {
+ zipFile.close();
+ }
+}