public class XDocArchive extends Object implements IEntryInputStreamProvider, IEntryReaderProvider, IEntryWriterProvider, IEntryOutputStreamProvider
XDocArchive is used to load zipped XML document archive (docx, odt...) XDocArchive cache each entry
zip to transform content stream with IXDocPreprocessor and ITemplateEngine.| Constructor and Description |
|---|
XDocArchive() |
XDocArchive(boolean trackLastModified) |
| Modifier and Type | Method and Description |
|---|---|
XDocArchive |
createCopy()
Create a copy of the
XDocArchive. |
void |
dispose() |
IEntryInfo |
getEntryInfo(String entryName) |
InputStream |
getEntryInputStream(String entryName)
Returns an
InputStream from the cache entries of the given entry. |
Set<String> |
getEntryNames()
Returns the entry names of the XML document archive by using cache entries.
|
Set<String> |
getEntryNames(String wildcard) |
OutputStream |
getEntryOutputStream(String entryName)
Returns an
OutputStream from the cache entries for writing the content of the given entry. |
Reader |
getEntryReader(String entryName)
Returns a
Reader (UTF-8) from the cache entries of the given entry. |
Writer |
getEntryWriter(String entryName)
Returns an
Writer from the cache entries for writing the content of the given entry. |
static InputStream |
getInputStream(XDocArchive archive)
Returns the input stream of the given
XDocArchive. |
long |
getLastModifiedEntry(String entryName) |
boolean |
hasEntry(String entryName)
Returns true if
XDocArchive contains an entry with the given name. |
static XDocArchive |
readZip(InputStream sourceStream)
Read zip from input stream and returns an instance of
XDocArchive which cache each entry from the zip
into a Map. |
static void |
setEntry(XDocArchive archive,
String entryName,
InputStream input)
Set the given input stream in the given entry of the document archive.
|
static void |
writeEntry(XDocArchive archive,
String entryName,
OutputStream outputStream)
Write the given entry from the document archive in the given output stream.
|
static void |
writeZip(XDocArchive archive,
OutputStream outputStream)
Write XML document archive in the given output stream.
|
public XDocArchive()
public XDocArchive(boolean trackLastModified)
public Set<String> getEntryNames()
public InputStream getEntryInputStream(String entryName)
InputStream from the cache entries of the given entry.getEntryInputStream in interface IEntryInputStreamProviderentryName - public Reader getEntryReader(String entryName)
Reader (UTF-8) from the cache entries of the given entry.getEntryReader in interface IEntryReaderProviderentryName - public OutputStream getEntryOutputStream(String entryName)
OutputStream from the cache entries for writing the content of the given entry.getEntryOutputStream in interface IEntryOutputStreamProviderentryName - OutputStreampublic Writer getEntryWriter(String entryName)
Writer from the cache entries for writing the content of the given entry.getEntryWriter in interface IEntryWriterProviderentryName - Writerpublic XDocArchive createCopy()
XDocArchive.public boolean hasEntry(String entryName)
XDocArchive contains an entry with the given name.entryName - public static XDocArchive readZip(InputStream sourceStream) throws IOException
XDocArchive which cache each entry from the zip
into a Map.sourceStream - stream of odt, docx file.IOExceptionpublic static void setEntry(XDocArchive archive, String entryName, InputStream input) throws IOException
archive - inputStream - IOExceptionpublic static void writeEntry(XDocArchive archive, String entryName, OutputStream outputStream) throws IOException
archive - outputStream - IOExceptionpublic static void writeZip(XDocArchive archive, OutputStream outputStream) throws IOException
archive - outputStream - IOExceptionpublic static InputStream getInputStream(XDocArchive archive) throws IOException
XDocArchive.archive - XDocArchive.IOExceptionpublic long getLastModifiedEntry(String entryName)
public IEntryInfo getEntryInfo(String entryName)
public void dispose()
Copyright © 2017. All Rights Reserved.