public class ZipArchive extends AbstractOpenXMLFormatsPartProvider
ZipArchive is used to load zipped XML document archive (docx, odt...) ZipArchive cache each entry zip
to transform content stream with IXDocPreprocessor and ITemplateEngine.| Constructor and Description |
|---|
ZipArchive() |
ZipArchive(boolean trackLastModified) |
| Modifier and Type | Method and Description |
|---|---|
ZipArchive |
createCopy()
Create a copy of the
ZipArchive. |
void |
dispose() |
java.io.InputStream |
getEntryInputStream(java.lang.String entryName)
Returns an
InputStream from the cache entries of the given entry. |
java.util.Set<java.lang.String> |
getEntryNames()
Returns the entry names of the XML document archive by using cache entries.
|
java.util.Set<java.lang.String> |
getEntryNames(java.lang.String wildcard) |
java.io.OutputStream |
getEntryOutputStream(java.lang.String entryName)
Returns an
OutputStream from the cache entries for writing the content of the given entry. |
long |
getLastModifiedEntry(java.lang.String entryName) |
boolean |
hasEntry(java.lang.String entryName)
Returns true if
ZipArchive contains an entry with the given name. |
static ZipArchive |
readZip(java.io.InputStream sourceStream)
Read zip from input stream and returns an instance of
ZipArchive which cache each entry from the zip into
a Map. |
static void |
setEntry(ZipArchive archive,
java.lang.String entryName,
java.io.InputStream input)
Set the given input stream in the given entry of the document archive.
|
static void |
writeEntry(ZipArchive archive,
java.lang.String entryName,
java.io.OutputStream outputStream)
Write the given entry from the document archive in the given output stream.
|
static void |
writeZip(ZipArchive archive,
java.io.OutputStream outputStream)
Write XML document archive in the given output stream.
|
getDocument, getFontsDocument, getFtrDocumentByPartId, getHdrDocumentByPartId, getInputStreamByRelId, getSettings, getStyle, getThemeDocumentspublic ZipArchive()
public ZipArchive(boolean trackLastModified)
public java.util.Set<java.lang.String> getEntryNames()
public java.util.Set<java.lang.String> getEntryNames(java.lang.String wildcard)
public java.io.InputStream getEntryInputStream(java.lang.String entryName)
InputStream from the cache entries of the given entry.getEntryInputStream in class AbstractOpenXMLFormatsPartProviderentryName - public java.io.OutputStream getEntryOutputStream(java.lang.String entryName)
OutputStream from the cache entries for writing the content of the given entry.entryName - OutputStreampublic ZipArchive createCopy()
ZipArchive.public boolean hasEntry(java.lang.String entryName)
ZipArchive contains an entry with the given name.entryName - public static ZipArchive readZip(java.io.InputStream sourceStream) throws java.io.IOException
ZipArchive which cache each entry from the zip into
a Map.sourceStream - stream of odt, docx file.java.io.IOExceptionpublic static void setEntry(ZipArchive archive, java.lang.String entryName, java.io.InputStream input) throws java.io.IOException
archive - inputStream - java.io.IOExceptionpublic static void writeEntry(ZipArchive archive, java.lang.String entryName, java.io.OutputStream outputStream) throws java.io.IOException
archive - outputStream - java.io.IOExceptionpublic static void writeZip(ZipArchive archive, java.io.OutputStream outputStream) throws java.io.IOException
archive - outputStream - java.io.IOExceptionpublic long getLastModifiedEntry(java.lang.String entryName)
public void dispose()
Copyright © 2019. All Rights Reserved.