Class UnzippedPartStore
java.lang.Object
org.docx4j.openpackaging.io3.stores.UnzippedPartStore
- All Implemented Interfaces:
PartStore
public class UnzippedPartStore extends java.lang.Object implements PartStore
Load an unzipped package from the file system;
save it to some output stream.
TODO convert path sep in part name to suit
underlying file system.
- Since:
- 3.0
- Author:
- jharrop
-
Constructor Summary
Constructors Constructor Description UnzippedPartStore(java.io.File dir) -
Method Summary
Modifier and Type Method Description voiddispose()voidfinishSave()Anything necessary to perfect the save operation.longgetPartSize(java.lang.String partName)The size of this part in bytes.java.io.InputStreamloadPart(java.lang.String partName)Returns null if the part does not exist.voidrename(PartName oldName, PartName newName)Rename a part in the part store.voidsaveBinaryPart(Part part)voidsaveContentTypes(ContentTypeManager ctm)voidsaveCustomXmlDataStoragePart(CustomXmlDataStoragePart part)voidsaveJaxbXmlPart(JaxbXmlPart part)voidsaveXmlPart(XmlPart part)voidsetOutputStream(java.io.OutputStream os)Does nothingvoidsetSourcePartStore(PartStore partStore)Set this if its different to the target part store (ie this object)
-
Constructor Details
-
UnzippedPartStore
- Throws:
Docx4JException
-
-
Method Details
-
setSourcePartStore
Set this if its different to the target part store (ie this object)- Specified by:
setSourcePartStorein interfacePartStore
-
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
-
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
public void setOutputStream(java.io.OutputStream os)Does nothing- Specified by:
setOutputStreamin interfacePartStore
-
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()
-