Class TarUtil


  • public class TarUtil
    extends Object
    Contains utility functions for TAR archives. Most importantly functions for handling entries with too long file names to fit in the header section.
    Version:
    2.5.1
    Author:
    nicklas
    Last modified
    $Date: 2015-05-12 11:27:08 +0200 (ti, 12 maj 2015) $
    • Field Detail

      • LONG_LINK_NAME

        public static final String LONG_LINK_NAME
        TAR has a limit of 100 characters in file names. Names that are longer store the actual filename in an entry with this name just before the real file (which usually has a truncated name entry).
        See Also:
        Constant Field Values
      • LONG_LINK_FLAG

        private static byte LONG_LINK_FLAG
        The TAR header flag that must be set for @LongLink entries.
    • Constructor Detail

      • TarUtil

        public TarUtil()
    • Method Detail

      • getNextEntry

        public static final com.ice.tar.TarEntry getNextEntry​(com.ice.tar.TarInputStream tarStream)
                                                       throws IOException
        Get the next entry from a TAR input stream. This method has support for long filenames. After calling this method the actual file data can be read from the stream.
        Parameters:
        tarStream - The TAR stream to read from
        Returns:
        The next entry or null if the end of stream has been reached
        Throws:
        IOException
      • putNextEntry

        public static final void putNextEntry​(com.ice.tar.TarEntry entry,
                                              com.ice.tar.TarOutputStream tarStream)
                                       throws IOException
        Put the next entry to a TAR stream. This method has support for long filenames and will automatically create all neccesary extra information inside the TAR stream. After calling this method the actual file data should be written to the stream.
        Parameters:
        entry - The next entry
        tarStream - The tar stream to write to
        Throws:
        IOException