Package net.sf.basedb.util.zip
Class TarUtil
java.lang.Object
net.sf.basedb.util.zip.TarUtil
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
Modifier and TypeFieldDescriptionprivate static byte
The TAR header flag that must be set for @LongLink entries.static final String
TAR has a limit of 100 characters in file names.static final int
Maximum file name length. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic final com.ice.tar.TarEntry
getNextEntry
(com.ice.tar.TarInputStream tarStream) Get the next entry from a TAR input stream.static final 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:
-
MAX_NAME_LENGTH
public static final int MAX_NAME_LENGTHMaximum file name length.- See Also:
-
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 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 entrytarStream
- The tar stream to write to- Throws:
IOException
-