Class StreamZipWriter
- java.lang.Object
-
- com.atlassian.confluence.impl.backuprestore.backup.container.StreamZipWriter
-
- All Implemented Interfaces:
ArchiveWriter,AutoCloseable
public class StreamZipWriter extends Object implements ArchiveWriter
Compresses a data stream into a zip archive.- Since:
- 7.20.0
-
-
Constructor Summary
Constructors Constructor Description StreamZipWriter(@NotNull OutputStream zippedOutputStream, @NotNull org.apache.commons.compress.archivers.zip.ParallelScatterZipCreator scatterZipCreator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Locking method that waits for all data to be archived and closes necessary resources.voidcompressFromStream(InputStream streamToZip, String pathInZip)Compresses data from the provided input stream into an archive.voidcompressFromStreamSupplier(org.apache.commons.compress.parallel.InputStreamSupplier streamSupplier, String pathInZip)Compresses data from the provided input stream supplier into an archive.
-
-
-
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:ArchiveWriterCompresses 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:
compressFromStreamSupplierin interfaceArchiveWriter- Parameters:
streamSupplier- - source stream supplierpathInZip- - path in the archive where entry is written to
-
compressFromStream
public void compressFromStream(InputStream streamToZip, String pathInZip)
Description copied from interface:ArchiveWriterCompresses 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:
compressFromStreamin interfaceArchiveWriter- Parameters:
streamToZip- - source streampathInZip- - path in the archive where entry is written to
-
close
public void close() throws BackupRestoreExceptionDescription copied from interface:ArchiveWriterLocking method that waits for all data to be archived and closes necessary resources.- Specified by:
closein interfaceArchiveWriter- Specified by:
closein interfaceAutoCloseable- Throws:
BackupRestoreException- - throws if any exception occurred
-
-