Class Archiver


  • public class Archiver
    extends java.lang.Object
    Provides a high level API for creating archives.
    Since:
    1.17
    • Constructor Summary

      Constructors 
      Constructor Description
      Archiver()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void create​(java.lang.String format, java.io.File target, java.io.File directory)
      Creates an archive target using the format format by recursively including all files and directories in directory.
      void create​(java.lang.String format, java.io.OutputStream target, java.io.File directory)
      Creates an archive target using the format format by recursively including all files and directories in directory.
      void create​(java.lang.String format, java.nio.channels.SeekableByteChannel target, java.io.File directory)
      Creates an archive target using the format format by recursively including all files and directories in directory.
      void create​(ArchiveOutputStream target, java.io.File directory)
      Creates an archive target by recursively including all files and directories in directory.
      void create​(SevenZOutputFile target, java.io.File directory)
      Creates an archive target by recursively including all files and directories in directory.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • create

        public void create​(java.lang.String format,
                           java.io.File target,
                           java.io.File directory)
                    throws java.io.IOException,
                           ArchiveException
        Creates an archive target using the format format by recursively including all files and directories in directory.
        Parameters:
        format - the archive format. This uses the same format as accepted by ArchiveStreamFactory.
        target - the file to write the new archive to.
        directory - the directory that contains the files to archive.
        Throws:
        java.io.IOException - if an I/O error occurs
        ArchiveException - if the archive cannot be created for other reasons
      • create

        public void create​(java.lang.String format,
                           java.io.OutputStream target,
                           java.io.File directory)
                    throws java.io.IOException,
                           ArchiveException
        Creates an archive target using the format format by recursively including all files and directories in directory.
        Parameters:
        format - the archive format. This uses the same format as accepted by ArchiveStreamFactory.
        target - the stream to write the new archive to.
        directory - the directory that contains the files to archive.
        Throws:
        java.io.IOException - if an I/O error occurs
        ArchiveException - if the archive cannot be created for other reasons
      • create

        public void create​(java.lang.String format,
                           java.nio.channels.SeekableByteChannel target,
                           java.io.File directory)
                    throws java.io.IOException,
                           ArchiveException
        Creates an archive target using the format format by recursively including all files and directories in directory.
        Parameters:
        format - the archive format. This uses the same format as accepted by ArchiveStreamFactory.
        target - the channel to write the new archive to.
        directory - the directory that contains the files to archive.
        Throws:
        java.io.IOException - if an I/O error occurs
        ArchiveException - if the archive cannot be created for other reasons
      • create

        public void create​(ArchiveOutputStream target,
                           java.io.File directory)
                    throws java.io.IOException,
                           ArchiveException
        Creates an archive target by recursively including all files and directories in directory.
        Parameters:
        target - the stream to write the new archive to.
        directory - the directory that contains the files to archive.
        Throws:
        java.io.IOException - if an I/O error occurs
        ArchiveException - if the archive cannot be created for other reasons
      • create

        public void create​(SevenZOutputFile target,
                           java.io.File directory)
                    throws java.io.IOException
        Creates an archive target by recursively including all files and directories in directory.
        Parameters:
        target - the file to write the new archive to.
        directory - the directory that contains the files to archive.
        Throws:
        java.io.IOException - if an I/O error occurs