Class TarUtil

java.lang.Object
net.sf.basedb.util.zip.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 Summary

    Fields
    Modifier and Type Field Description
    private static byte LONG_LINK_FLAG
    The TAR header flag that must be set for @LongLink entries.
    static String LONG_LINK_NAME
    TAR has a limit of 100 characters in file names.
    static int MAX_NAME_LENGTH
    Maximum file name length.
  • Constructor Summary

    Constructors
    Constructor Description
    TarUtil()  
  • Method Summary

    Modifier and Type Method Description
    static com.ice.tar.TarEntry getNextEntry​(com.ice.tar.TarInputStream tarStream)
    Get the next entry from a TAR input stream.
    static void putNextEntry​(com.ice.tar.TarEntry entry, com.ice.tar.TarOutputStream tarStream)
    Put the next entry to a TAR stream.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MAX_NAME_LENGTH

      public static final int MAX_NAME_LENGTH
      Maximum file name length.
      See Also:
      LONG_LINK_NAME, Constant Field Values
  • Constructor Details

    • TarUtil

      public TarUtil()
  • Method Details

    • 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