Class ZipPartStore
java.lang.Object
org.docx4j.openpackaging.io3.stores.ZipPartStore
- All Implemented Interfaces:
PartStore
Load a zipped up package from a file or input stream;
save it to some output stream.
- Since:
- 3.0
- Author:
- jharrop
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()voidAnything necessary to perfect the save operation.getByteArray(String partName) This method is to facilitate updating the part without JAXB unmarshalling then marshalling.longgetPartSize(String partName) The size of this part in bytes.Returns null if the part does not exist.booleanpartExists(String partName) voidRename a part in the part store.voidsaveBinaryPart(Part part) voidvoidvoidsaveJaxbXmlPart(JaxbXmlPart part) voidsaveXmlPart(XmlPart part) voidvoidsetSourcePartStore(PartStore partStore) Set this if its different to the target part store (ie this object)
-
Constructor Details
-
ZipPartStore
public ZipPartStore() -
ZipPartStore
- Throws:
Docx4JException
-
ZipPartStore
- Throws:
Docx4JException
-
-
Method Details
-
setSourcePartStore
Set this if its different to the target part store (ie this object)- Specified by:
setSourcePartStorein interfacePartStore
-
partExists
-
loadPart
Description copied from interface:PartStoreReturns null if the part does not exist. This will happen when calling code optimistically tries to fetch a rels part (which may or may not exist). Note: JaxbXmlPart and JaxbXmlPartXPathAware both unmarshal lazily (ie can invoke this sometime after the docx is loaded). Caller (generally docx4j itself) should close the resulting InputStream after use.- Specified by:
loadPartin interfacePartStore- Returns:
- Throws:
Docx4JException
-
getPartSize
Description copied from interface:PartStoreThe size of this part in bytes. Return -1 if the part does not exist.- Specified by:
getPartSizein interfacePartStore- Returns:
- Throws:
Docx4JException
-
getByteArray
This method is to facilitate updating the part without JAXB unmarshalling then marshalling. Not intended for direct use by user code.- Parameters:
partName-- Returns:
- Throws:
Docx4JException- Since:
- 3.3.2
-
rename
Description copied from interface:PartStoreRename a part in the part store. Useful where a part is being renamed, but its content has not been loaded. (The existing approach is to manually force the content to be loaded) -
setOutputStream
- Specified by:
setOutputStreamin interfacePartStore- Parameters:
zipOutputStream- the zipOutputStream to set
-
saveContentTypes
- Specified by:
saveContentTypesin interfacePartStore- Throws:
Docx4JException
-
saveJaxbXmlPart
- Specified by:
saveJaxbXmlPartin interfacePartStore- Throws:
Docx4JException
-
saveCustomXmlDataStoragePart
- Specified by:
saveCustomXmlDataStoragePartin interfacePartStore- Throws:
Docx4JException
-
saveXmlPart
- Specified by:
saveXmlPartin interfacePartStore- Throws:
Docx4JException
-
saveBinaryPart
- Specified by:
saveBinaryPartin interfacePartStore- Throws:
Docx4JException
-
finishSave
Description copied from interface:PartStoreAnything necessary to perfect the save operation. For example,- Specified by:
finishSavein interfacePartStore- Throws:
Docx4JException
-
dispose
public void dispose()
-