Class StreamZipWriter

    • Constructor Detail

      • StreamZipWriter

        public StreamZipWriter​(@NotNull
                               @NotNull OutputStream zippedOutputStream,
                               @NotNull
                               @NotNull org.apache.commons.compress.archivers.zip.ParallelScatterZipCreator scatterZipCreator)
                        throws IOException
        Throws:
        IOException
    • Method Detail

      • compressFromStreamSupplier

        public void compressFromStreamSupplier​(org.apache.commons.compress.parallel.InputStreamSupplier streamSupplier,
                                               String pathInZip)
        Description copied from interface: ArchiveWriter
        Compresses data from the provided input stream supplier into an archive. The provided input stream will be closed by the ArchiveWriter implementation. Use this method if all data is available for compression when the stream opens.
        Specified by:
        compressFromStreamSupplier in interface ArchiveWriter
        Parameters:
        streamSupplier - - source stream supplier
        pathInZip - - path in the archive where entry is written to
      • compressFromStreamSupplier

        public void compressFromStreamSupplier​(org.apache.commons.compress.parallel.InputStreamSupplier streamSupplier,
                                               String pathInZip,
                                               String comment)
        Description copied from interface: ArchiveWriter
        Compresses data from the provided input stream supplier into an archive. The provided input stream will be closed by the ArchiveWriter implementation. Use this method if all data is available for compression when the stream opens. You can use the comment param to avoid issue with uniqueness of zip entries (potential crash). See CONFSRVDEV-25060 for more details.
        Specified by:
        compressFromStreamSupplier in interface ArchiveWriter
        Parameters:
        streamSupplier - - source stream supplier
        pathInZip - - path in the archive where entry is written to
        comment - - comment for the compressed file
      • compressFromStream

        public void compressFromStream​(InputStream streamToZip,
                                       String pathInZip)
        Description copied from interface: ArchiveWriter
        Compresses data from the provided input stream into an archive. The input stream will be closed by the ArchiveWriter implementation. Use this method if the streamed data size is unknown when opened.
        Specified by:
        compressFromStream in interface ArchiveWriter
        Parameters:
        streamToZip - - source stream
        pathInZip - - path in the archive where entry is written to
      • compressFromStream

        public void compressFromStream​(InputStream streamToZip,
                                       String pathInZip,
                                       String comment)
        Description copied from interface: ArchiveWriter
        Compresses data from the provided input stream into an archive. The input stream will be closed by the ArchiveWriter implementation. Use this method if the streamed data size is unknown when opened. You can use the comment param to avoid issue with uniqueness of zip entries (potential crash). See CONFSRVDEV-25060 for more details.
        Specified by:
        compressFromStream in interface ArchiveWriter
        Parameters:
        streamToZip - - source stream
        pathInZip - - path in the archive where entry is written to
        comment - - additional comment stored with the compressed file