import org.apache.poi.openxml4j.util.ZipEntrySource;
import org.apache.poi.openxml4j.util.ZipFileZipEntrySource;
import org.apache.poi.openxml4j.util.ZipInputStreamZipEntrySource;
-import org.apache.poi.util.POILogger;
import org.apache.poi.util.POILogFactory;
+import org.apache.poi.util.POILogger;
/**
* Physical zip package.
}
/**
- * Constructor. <b>Operation not supported.</b>
+ * Constructor. Opens a Zip based Open XML document from
+ * an InputStream.
*
* @param in
* Zip input stream to load.
* @param access
+ * The package access mode.
* @throws IllegalArgumentException
* If the specified input stream not an instance of
* ZipInputStream.
}
/**
- * Constructor. Opens a Zip based Open XML document.
+ * Constructor. Opens a Zip based Open XML document from a File.
*
* @param path
* The path of the file to open or create.
this.zipArchive = new ZipFileZipEntrySource(zipFile);
}
+ /**
+ * Constructor. Opens a Zip based Open XML document from
+ * a custom ZipEntrySource, typically an open archive
+ * from another system
+ *
+ * @param zipEntry
+ * Zip data to load.
+ * @param access
+ * The package access mode.
+ * @throws InvalidFormatException
+ * If the content type part parsing encounters an error.
+ */
+ ZipPackage(ZipEntrySource zipEntry, PackageAccess access) {
+ super(access);
+ this.zipArchive = zipEntry;
+ }
+
/**
* Retrieves the parts from this package. We assume that the package has not
* been yet inspect to retrieve all the parts, this method will open the