@NotThreadSafe public class Nzip extends TApplication<RuntimeException>
cat
, cp
, rm
, mkdir
,
rmdir
, ls
etc.).
Please note that TrueZIP is designed for optimum performance.
However, this utility features some optional archive drivers which
provide additional safety or otherwise unavailable features.
Some of these drivers are not used in their default configuration -
see TArchiveDetector
for more
information.
For example, the ZIP drivers used in this utility always check
the CRC-32 values provided in the ZIP file.
In addition, the SFX driver is used which allows you to browse
.exe
files if they happen to be SelF eXtracting archives (SFX).
If they are not however, TrueZIP may spend some considerable amount of
time searching for the Central Directory required to be present in ZIP
(and hence SFX) files.
As a conclusion, this utility should not serve as a performance benchmark.
Modifier and Type | Class and Description |
---|---|
protected static class |
Nzip.IllegalUsageException |
Modifier and Type | Field and Description |
---|---|
protected PrintStream |
err
The print stream for error output.
|
protected PrintStream |
out
The print stream for standard output.
|
Constructor and Description |
---|
Nzip() |
Modifier and Type | Method and Description |
---|---|
static void |
main(String[] args)
Equivalent to
System.exit(new Nzip().run(args)); . |
protected TArchiveDetector |
newArchiveDetector()
May be overridden by subclasses to create the
TArchiveDetector which provides file system drivers which
should use the specified charset if supported. |
protected TArchiveDetector |
newArchiveDetector(Charset charset) |
protected int |
runChecked(String[] args)
Runs this command line utility.
|
protected void |
setup()
Configures the type of the feedback when prompting the user for keys
for RAES encrypted ZIP alias ZIP.RAES alias TZP files by the Swing
based prompting key manager.
|
protected int |
work(String[] args)
Runs the work phase by calling
runChecked(java.lang.String[]) . |
run, sync
protected final PrintStream err
protected final PrintStream out
public static void main(String[] args) throws FsSyncException
System.exit(new Nzip().run(args));
.FsSyncException
protected TArchiveDetector newArchiveDetector()
TArchiveDetector
which provides file system drivers which
should use the specified charset if supported.
Note that the archive detector which is returned by the implementation in this class uses some archive drivers which may be pretty slow due to some extra compatibility tests which they perform on every archive.
protected TArchiveDetector newArchiveDetector(Charset charset)
newArchiveDetector()
protected int runChecked(String[] args) throws Nzip.IllegalUsageException, IOException
args
- A non-empty array of Unix-like commands and optional
parameters.false
iff the command is a test which fails,
true
otherwise.Nzip.IllegalUsageException
- If args
does not contain
correct commands or parameters.IOException
- On any I/O error.protected void setup()
setup
in class TApplication<RuntimeException>
protected final int work(String[] args)
runChecked(java.lang.String[])
.
Prints a user readable error message to the error output stream
which was provided to the constructor if an occurs
.
This method is run
at least once and repeatedly called
until runChecked(java.lang.String[])
returns a non-negative integer for use as the
exist status
of the VM.
After this method, the TApplication.sync()
method is called in a
finally-block.
work
in class TApplication<RuntimeException>
args
- an array of arguments for this command line utility.exit status
of the VM.RuntimeException
- at the discretion of runChecked(java.lang.String[])
.Copyright © 2005–2018 Schlichtherle IT Services. All rights reserved.