Class TarArchiver

    • Constructor Detail

      • TarArchiver

        public TarArchiver()
    • Method Detail

      • setLongfile

        public void setLongfile​(TarLongFileMode mode)
        Set how to handle long files, those with a path>100 chars. Optional, default=warn.

        Allowable values are

        • truncate - paths are truncated to the maximum length
        • fail - paths greater than the maximum cause a build exception
        • warn - paths greater than the maximum cause a warning and GNU is used
        • gnu - GNU extensions are used for any paths greater than the maximum.
        • posix - posix extensions are used for any paths greater than the maximum.
        • posixwarn - posix extensions are used (with warning) for any paths greater than the maximum.
        • omit - paths greater than the maximum are omitted from the archive
        Parameters:
        mode - the mode to handle long file names.
      • setCompression

        public void setCompression​(TarArchiver.TarCompressionMethod mode)
        Set compression method. Allowable values are
        • none - no compression
        • gzip - Gzip compression
        • bzip2 - Bzip2 compression
        Parameters:
        mode - the compression method.
      • tarFile

        protected void tarFile​(ArchiveEntry entry,
                               org.apache.commons.compress.archivers.tar.TarArchiveOutputStream tOut,
                               java.lang.String vPath)
                        throws ArchiverException,
                               java.io.IOException
        tar a file
        Parameters:
        entry - the file to tar
        tOut - the output stream
        vPath - the path name of the file to tar
        Throws:
        java.io.IOException - on error
        ArchiverException
      • cleanUp

        protected void cleanUp()
                        throws java.io.IOException
        Overrides:
        cleanUp in class AbstractArchiver
        Throws:
        java.io.IOException
      • close

        protected void close()
                      throws java.io.IOException
        Specified by:
        close in class AbstractArchiver
        Throws:
        java.io.IOException