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.

@FunctionalInterface public interface TarArchive
A TAR archive that can be written to an output stream.
Since:
2.3.0
Author:
Phillip Webb
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Instant
    Instant that can be used to normalize TAR files so all entries have the same modification time.
  • Method Summary

    Modifier and Type
    Method
    Description
    static TarArchive
    fromZip(File zip, Owner owner)
    Factory method to adapt a ZIP file to TarArchive.
    static TarArchive
    of(IOConsumer<Layout> layout)
    Factory method to create a new TarArchive instance with a specific layout.
    void
    writeTo(OutputStream outputStream)
    Write the TAR archive to the given output stream.
  • Field Details

    • NORMALIZED_TIME

      static final Instant NORMALIZED_TIME
      Instant that can be used to normalize TAR files so all entries have the same modification time.
  • Method Details

    • writeTo

      void writeTo(OutputStream outputStream) throws IOException
      Write the TAR archive to the given output stream.
      Parameters:
      outputStream - the output stream to write to
      Throws:
      IOException - on IO error
    • of

      static TarArchive of(IOConsumer<Layout> layout)
      Factory method to create a new TarArchive instance with a specific layout.
      Parameters:
      layout - the TAR layout
      Returns:
      a new TarArchive instance
    • fromZip

      static TarArchive fromZip(File zip, Owner owner)
      Factory method to adapt a ZIP file to TarArchive.
      Parameters:
      zip - the source zip file
      owner - the owner of the entries in the TAR
      Returns:
      a new TarArchive instance