Package net.sf.basedb.util.zip
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.
-
Field Details
-
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
-
MAX_NAME_LENGTH
public static final int MAX_NAME_LENGTHMaximum file name length.- See Also:
LONG_LINK_NAME
, Constant Field Values
-
LONG_LINK_FLAG
private static byte LONG_LINK_FLAGThe TAR header flag that must be set for @LongLink entries.
-
-
Constructor Details
-
TarUtil
public TarUtil()
-
-
Method Details
-
getNextEntry
public static final com.ice.tar.TarEntry getNextEntry(com.ice.tar.TarInputStream tarStream) throws IOExceptionGet 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 IOExceptionPut 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 entrytarStream
- The tar stream to write to- Throws:
IOException
-