Class ZipPackage

    • Constructor Detail

      • ZipPackage

        public ZipPackage()
        Constructor. Creates a new, empty ZipPackage.
    • Method Detail

      • setUseTempFilePackageParts

        public static void setUseTempFilePackageParts​(boolean tempFilePackageParts)
        Parameters:
        tempFilePackageParts - whether to save package part data in temp files to save memory
      • setEncryptTempFilePackageParts

        public static void setEncryptTempFilePackageParts​(boolean encryptTempFiles)
        Parameters:
        encryptTempFiles - whether to encrypt package part temp files
      • useTempFilePackageParts

        public static boolean useTempFilePackageParts()
        Returns:
        whether package part data is stored in temp files to save memory
      • encryptTempFilePackageParts

        public static boolean encryptTempFilePackageParts()
        Returns:
        whether package part temp files are encrypted
      • getPartsImpl

        protected PackagePartCollection getPartsImpl()
                                              throws InvalidFormatException
        Retrieves the parts from this package. We assume that the package has not been yet inspect to retrieve all the parts, this method will open the archive and look for all parts contain inside it.
        Specified by:
        getPartsImpl in class OPCPackage
        Returns:
        All parts contain in this package.
        Throws:
        InvalidFormatException - if the package is not valid.
      • createPartImpl

        protected PackagePart createPartImpl​(PackagePartName partName,
                                             String contentType,
                                             boolean loadRelationships)
        Create a new MemoryPackagePart from the specified URI and content type
        Specified by:
        createPartImpl in class OPCPackage
        Parameters:
        partName - The part name.
        contentType - The part content type.
        loadRelationships - whether to load relationships.
        Returns:
        The newly created zip package part, else null.
        Throws:
        IllegalArgumentException - if partName or contentType is null
      • flushImpl

        protected void flushImpl()
        Flush the package. Do nothing.
        Specified by:
        flushImpl in class OPCPackage
      • revertImpl

        protected void revertImpl()
        Close the package without saving the document. Discard all the changes made to this package.
        Specified by:
        revertImpl in class OPCPackage
      • getZipArchive

        public ZipEntrySource getZipArchive()
        Get the zip archive
        Returns:
        The zip archive.
      • isClosed

        public boolean isClosed()
        Description copied from class: OPCPackage
        Has close been called already?
        Specified by:
        isClosed in class OPCPackage