Class PackageHelper


  • public final class PackageHelper
    extends java.lang.Object
    Provides handy methods to work with OOXML packages
    • Constructor Summary

      Constructors 
      Constructor Description
      PackageHelper()  
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static OPCPackage clone​(OPCPackage pkg, java.io.File file)
      Deprecated.
      this method is not used internally and creates temp files that are not well handled
      static OPCPackage open​(java.io.InputStream is)  
      static OPCPackage open​(java.io.InputStream stream, boolean closeStream)  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PackageHelper

        public PackageHelper()
    • Method Detail

      • open

        public static OPCPackage open​(java.io.InputStream is)
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • open

        public static OPCPackage open​(java.io.InputStream stream,
                                      boolean closeStream)
                               throws java.io.IOException
        Parameters:
        stream - The InputStream to read from
        closeStream - whether to close the stream (default is false)
        Returns:
        OPCPackage
        Throws:
        java.io.IOException - If reading data from the stream fails
        Since:
        POI 5.2.0
      • clone

        @Deprecated
        @Removal(version="6.0.0")
        public static OPCPackage clone​(OPCPackage pkg,
                                       java.io.File file)
                                throws OpenXML4JException,
                                       java.io.IOException
        Deprecated.
        this method is not used internally and creates temp files that are not well handled
        Clone the specified package.
        Parameters:
        pkg - the package to clone
        file - the destination file
        Returns:
        the cloned package
        Throws:
        OpenXML4JException
        java.io.IOException