Interface TarArchive
- All Known Implementing Classes:
ImageArchive
,ZipFileTarArchive
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A TAR archive that can be written to an output stream.
- Since:
- 2.3.0
- Author:
- Phillip Webb
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Compression type applied to the archive. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic TarArchive
fromInputStream
(InputStream inputStream, TarArchive.Compression compression) Factory method to adapt a ZIP file toTarArchive
.static TarArchive
Factory method to adapt a ZIP file toTarArchive
.default TarArchive.Compression
Return the compression being used with the tar archive.static TarArchive
of
(IOConsumer<Layout> layout) Factory method to create a newTarArchive
instance with a specific layout.void
writeTo
(OutputStream outputStream) Write the TAR archive to the given output stream.
-
Field Details
-
NORMALIZED_TIME
Instant
that can be used to normalize TAR files so all entries have the same modification time.
-
-
Method Details
-
writeTo
Write the TAR archive to the given output stream.- Parameters:
outputStream
- the output stream to write to- Throws:
IOException
- on IO error
-
getCompression
Return the compression being used with the tar archive.- Returns:
- the used compression
- Since:
- 3.2.6
-
of
Factory method to create a newTarArchive
instance with a specific layout.- Parameters:
layout
- the TAR layout- Returns:
- a new
TarArchive
instance
-
fromZip
Factory method to adapt a ZIP file toTarArchive
.- Parameters:
zip
- the source zip fileowner
- the owner of the entries in the TAR- Returns:
- a new
TarArchive
instance
-
fromInputStream
Factory method to adapt a ZIP file toTarArchive
. Assumes thatwriteTo(OutputStream)
will only be called once.- Parameters:
inputStream
- the source input streamcompression
- the compression used- Returns:
- a new
TarArchive
instance - Since:
- 3.2.6
-