Package org.docx4j.openpackaging.io
Class LoadFromZipNG
java.lang.Object
org.docx4j.openpackaging.io.Load
org.docx4j.openpackaging.io.LoadFromZipNG
Deprecated.
Create a Package object from a Zip file or input stream.
This class is a refactoring of LoadFromZipFile, which
couldn't read from an input stream
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from class org.docx4j.openpackaging.io.Load
customXmlDataStorageClass, loadExternalTargets -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddPartsFromRelationships(HashMap<String, LoadFromZipNG.ByteArray> partByteArrays, Base source, RelationshipsPart rp, ContentTypeManager ctm) Deprecated.Deprecated.get(InputStream is) Deprecated.Deprecated.static PartgetBinaryPart(HashMap<String, LoadFromZipNG.ByteArray> partByteArrays, ContentTypeManager ctm, String resolvedPartUri) Deprecated.static byte[]getBytesFromInputStream(InputStream is, long size) Deprecated.private static InputStreamgetInputStreamFromZippedPart(HashMap<String, LoadFromZipNG.ByteArray> partByteArrays, String partName) Deprecated.private voidgetPart(HashMap<String, LoadFromZipNG.ByteArray> partByteArrays, OpcPackage pkg, RelationshipsPart rp, Relationship r, ContentTypeManager ctm) Deprecated.Get a Part (except a relationships part), and all its related parts.static PartgetRawPart(HashMap<String, LoadFromZipNG.ByteArray> partByteArrays, ContentTypeManager ctm, String resolvedPartUri, Relationship rel) Deprecated.Get a Part (except a relationships part), but not its relationships part or related parts.getRelationshipsPart(HashMap<String, LoadFromZipNG.ByteArray> partByteArrays, Part part) Deprecated.Get the Relationships Part (if there is one) for a given Part.private RelationshipsPartgetRelationshipsPartFromZip(Base p, HashMap<String, LoadFromZipNG.ByteArray> partByteArrays, String partName) Deprecated.static voidDeprecated.private voidpopulatePackageRels(HashMap<String, LoadFromZipNG.ByteArray> partByteArrays, RelationshipsPart rp) Deprecated.private OpcPackageprocess(HashMap<String, LoadFromZipNG.ByteArray> partByteArrays) Deprecated.Methods inherited from class org.docx4j.openpackaging.io.Load
getCustomXmlDataStorageClass, getRawPart, loadExternalTargets, registerCustomXmlDataStorageParts, setCustomXmlDataStorageClass
-
Field Details
-
log
private static org.slf4j.Logger logDeprecated.
-
-
Constructor Details
-
LoadFromZipNG
public LoadFromZipNG()Deprecated.
-
-
Method Details
-
main
Deprecated.- Throws:
Exception
-
get
Deprecated.- Throws:
Docx4JException
-
getBytesFromInputStream
Deprecated.- Throws:
Exception
-
get
Deprecated.- Throws:
Docx4JException
-
get
Deprecated.- Throws:
Docx4JException
-
process
private OpcPackage process(HashMap<String, LoadFromZipNG.ByteArray> partByteArrays) throws Docx4JExceptionDeprecated.- Throws:
Docx4JException
-
populatePackageRels
private void populatePackageRels(HashMap<String, LoadFromZipNG.ByteArray> partByteArrays, RelationshipsPart rp) throws Docx4JExceptionDeprecated.- Throws:
Docx4JException
-
getRelationshipsPartFromZip
private RelationshipsPart getRelationshipsPartFromZip(Base p, HashMap<String, LoadFromZipNG.ByteArray> partByteArrays, String partName) throws Docx4JExceptionDeprecated.- Throws:
Docx4JException
-
getInputStreamFromZippedPart
private static InputStream getInputStreamFromZippedPart(HashMap<String, LoadFromZipNG.ByteArray> partByteArrays, String partName) throws IOExceptionDeprecated.- Throws:
IOException
-
addPartsFromRelationships
private void addPartsFromRelationships(HashMap<String, LoadFromZipNG.ByteArray> partByteArrays, Base source, RelationshipsPart rp, ContentTypeManager ctm) throws Docx4JExceptionDeprecated.- Throws:
Docx4JException
-
getPart
private void getPart(HashMap<String, LoadFromZipNG.ByteArray> partByteArrays, OpcPackage pkg, RelationshipsPart rp, Relationship r, ContentTypeManager ctm) throws Docx4JException, InvalidFormatException, URISyntaxExceptionDeprecated.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(HashMap<String, LoadFromZipNG.ByteArray> partByteArrays, Part part) throws Docx4JException, InvalidFormatExceptionDeprecated.Get the Relationships Part (if there is one) for a given Part. Otherwise return null.- Parameters:
zf-part-- Returns:
- Throws:
InvalidFormatExceptionDocx4JException
-
getRawPart
public static Part getRawPart(HashMap<String, LoadFromZipNG.ByteArray> partByteArrays, ContentTypeManager ctm, String resolvedPartUri, Relationship rel) throws Docx4JExceptionDeprecated.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
public static Part getBinaryPart(HashMap<String, LoadFromZipNG.ByteArray> partByteArrays, ContentTypeManager ctm, String resolvedPartUri) throws Docx4JExceptionDeprecated.- Throws:
Docx4JException
-