Class ZipPartMarshaller

  • All Implemented Interfaces:
    PartMarshaller

    public final class ZipPartMarshaller
    extends java.lang.Object
    implements PartMarshaller
    Zip part marshaller. This marshaller is use to save any part in a zip stream.
    • Constructor Detail

      • ZipPartMarshaller

        public ZipPartMarshaller()
    • Method Detail

      • marshall

        public boolean marshall​(PackagePart part,
                                java.io.OutputStream os)
                         throws OpenXML4JException
        Save the specified part to the given stream.
        Specified by:
        marshall in interface PartMarshaller
        Parameters:
        part - The PackagePart to save
        os - The stream to write the data to
        Returns:
        true if saving was successful or there was nothing to save, false if an error occurred. In case of errors, logging via Log4j 2 is used to provide more information.
        Throws:
        OpenXML4JException - Throws if the stream cannot be written to or an internal exception is thrown.
      • marshallRelationshipPart

        public static boolean marshallRelationshipPart​(PackageRelationshipCollection rels,
                                                       PackagePartName relPartName,
                                                       ZipArchiveOutputStream zos)
        Save relationships into the part.
        Parameters:
        rels - The relationships collection to marshall.
        relPartName - Part name of the relationship part to marshall.
        zos - Zip output stream in which to save the XML content of the relationships serialization.
        Returns:
        true if saving was successful, false if an error occurred. In case of errors, logging via Log4j 2 is used to provide more information.