public class tar extends Object implements TarProgressDisplay
usage: com.ice.tar.tar has three basic modes: com.ice.tar -c [options] archive files... Create new archive containing files. com.ice.tar -t [options] archive List contents of tar archive com.ice.tar -x [options] archive Extract contents of tar archive. options: -f file, use 'file' as the tar archive -v, verbose mode -z, use GZIP compression -D, debug archive and buffer operation -b blks, set blocking size to (blks * 512) bytes -o, write a V7 format archive rather than ANSI -u name, set user name to 'name' -U id, set user id to 'id' -g name, set group name to 'name' -G id, set group id to 'id' -?, print usage information --trans, translate 'text/*' files --mime file, use this mime types file and translate --usage, print usage information --version, print version information The translation options will translate from local line endings to UNIX line endings of '\\n' when writing tar archives, and from UNIX line endings into local line endings when extracting archives. Written by Tim Endres This software has been placed into the public domain.
TarArchive
Modifier and Type | Field and Description |
---|---|
private String |
archiveName
The archive name provided on the command line, null if stdio.
|
private boolean |
asciiTranslate
True if we are to convert ASCII text files from local line endings
to the UNIX standard '\n'.
|
private int |
blockSize
The blocksize to use for the tar archive IO.
|
private boolean |
compressed
Flag that determines if IO is GZIP-ed ('-z' option).
|
private boolean |
debug
Flag that determines if debugging information is displayed.
|
private int |
groupId
The groupId to use for files written to archives.
|
private String |
groupName
The groupName to use for files written to archives.
|
private boolean |
keepOldFiles
True if we are not to overwrite existing files.
|
private boolean |
listingArchive
True if we are listing the archive.
|
private boolean |
mimeFileLoaded
True if a MIME file has been loaded with the '--mime' option.
|
private boolean |
unixArchiveFormat
True if we are writing an old UNIX archive format (sets entry format).
|
private int |
userId
The userId to use for files written to archives.
|
private String |
userName
The userName to use for files written to archives.
|
private boolean |
verbose
Flag that determines if verbose feedback is provided.
|
private boolean |
writingArchive
True if we are writing the archive.
|
Constructor and Description |
---|
tar()
Establishes the default userName with the 'user.name' property.
|
Modifier and Type | Method and Description |
---|---|
void |
instanceMain(String[] argv)
This is the "real" main.
|
static void |
main(String[] argv)
The main entry point of the tar class.
|
private int |
processArguments(String[] args)
Process arguments, handling options, and return the index of the
first non-option argument.
|
void |
showTarProgressMessage(String msg)
Display progress information by printing it to System.out.
|
private void |
usage()
Print usage information.
|
private void |
version()
Print version information.
|
private boolean debug
private boolean verbose
private boolean compressed
private boolean listingArchive
private boolean writingArchive
private boolean unixArchiveFormat
private boolean keepOldFiles
private boolean asciiTranslate
private boolean mimeFileLoaded
private String archiveName
private int blockSize
private int userId
private String userName
private int groupId
public tar()
public void instanceMain(String[] argv)
private int processArguments(String[] args)
public void showTarProgressMessage(String msg)
showTarProgressMessage
in interface TarProgressDisplay
msg
- The message to display.private void version()
private void usage()
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses