接口 TarArchive

所有已知实现类:
ImageArchive, ZipFileTarArchive
函数接口:
这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。

@FunctionalInterface public interface TarArchive
A TAR archive that can be written to an output stream.
从以下版本开始:
2.3.0
作者:
Phillip Webb
  • 字段详细资料

    • NORMALIZED_TIME

      static final Instant NORMALIZED_TIME
      Instant that can be used to normalize TAR files so all entries have the same modification time.
  • 方法详细资料

    • writeTo

      void writeTo(OutputStream outputStream) throws IOException
      Write the TAR archive to the given output stream.
      参数:
      outputStream - the output stream to write to
      抛出:
      IOException - on IO error
    • getCompression

      default TarArchive.Compression getCompression()
      Return the compression being used with the tar archive.
      返回:
      the used compression
      从以下版本开始:
      3.2.6
    • of

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

      static TarArchive fromZip(File zip, Owner owner)
      Factory method to adapt a ZIP file to TarArchive.
      参数:
      zip - the source zip file
      owner - the owner of the entries in the TAR
      返回:
      a new TarArchive instance
    • fromInputStream

      static TarArchive fromInputStream(InputStream inputStream, TarArchive.Compression compression)
      Factory method to adapt a ZIP file to TarArchive. Assumes that writeTo(OutputStream) will only be called once.
      参数:
      inputStream - the source input stream
      compression - the compression used
      返回:
      a new TarArchive instance
      从以下版本开始:
      3.2.6