Package org.docx4j.openpackaging.io3
Class Load3
java.lang.Object
org.docx4j.openpackaging.io.Load
org.docx4j.openpackaging.io3.Load3
Create a Package object using a PartLoader.
This class doesn't care how the parts are physically
stored (that is PartLoader's problem).
What this class knows how to do is to traverse the
opc, via its relationships. It would be possible/interesting
to have a design which lazily followed the rels, but
we don't do that. All rel parts are unmarshalled
and traversed when invoked.
- Author:
- jharrop
-
Field Summary
Fields inherited from class org.docx4j.openpackaging.io.Load
customXmlDataStorageClass, loadExternalTargets -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget()getBinaryPart(ContentTypeManager ctm, String resolvedPartUri) protected voidgetPart(OpcPackage pkg, RelationshipsPart rp, Relationship r, ContentTypeManager ctm) Get a Part (except a relationships part), and all its related parts.getRawPart(ContentTypeManager ctm, String resolvedPartUri, Relationship rel, RelationshipsPart rp) Get a Part (except a relationships part), but not its relationships part or related parts.getRelationshipsPart(Part part) Get the Relationships Part (if there is one) for a given Part.voidreuseExistingOpcPackage(OpcPackage existingPkg) By setting this, you can load the contents into this existing package (ie instead of returning a new one).Methods inherited from class org.docx4j.openpackaging.io.Load
getCustomXmlDataStorageClass, getRawPart, loadExternalTargets, registerCustomXmlDataStorageParts, setCustomXmlDataStorageClass
-
Constructor Details
-
Load3
-
Load3
public Load3()
-
-
Method Details
-
reuseExistingOpcPackage
By setting this, you can load the contents into this existing package (ie instead of returning a new one).- Parameters:
existingPkg-- Since:
- 3.3.7
-
get
- Throws:
Docx4JException
-
getPart
protected void getPart(OpcPackage pkg, RelationshipsPart rp, Relationship r, ContentTypeManager ctm) throws Docx4JException, InvalidFormatException, URISyntaxException Get a Part (except a relationships part), and all its related parts. This can be called directly from outside the library, in which case the Part will not be owned by a Package until the calling code makes it so.- Parameters:
zf-source-unusedZipEntries-pkg-r-resolvedPartUri-- Throws:
Docx4JExceptionInvalidFormatExceptionURISyntaxException
-
getRelationshipsPart
public RelationshipsPart getRelationshipsPart(Part part) throws Docx4JException, InvalidFormatException Get the Relationships Part (if there is one) for a given Part. Otherwise return null.- Parameters:
zf-part-- Returns:
- Throws:
InvalidFormatExceptionDocx4JException
-
getRawPart
public Part getRawPart(ContentTypeManager ctm, String resolvedPartUri, Relationship rel, RelationshipsPart rp) throws Docx4JException Get a Part (except a relationships part), but not its relationships part or related parts. Useful if you need quick access to just this part. This can be called directly from outside the library, in which case the Part will not be owned by a Package until the calling code makes it so.- Parameters:
partByteArrays-ctm-resolvedPartUri-rel-- Returns:
- Throws:
Docx4JException- including if result is null- See Also:
-
get a Part and all its related parts, and add all to a package, use getPart.
-
getBinaryPart
- Throws:
Docx4JException
-