public class Encrypt extends TApplication<RuntimeException>
Please note that you should not use this utility to encrypt a plain
ZIP file to an RAES encrypted ZIP file (usually a files with a
".tzp"
or ".zip.rae"
suffix).
This is because RAES encrypted ZIP files use the "UTF-8"
as their character set, whereas plain ZIP files use "IBM437",
a.k.a. "CP437".
To encrypt a plain ZIP file to an RAES encrypted ZIP file, use the
cp
command of the Nzip
class instead.
This class knows about the correct character sets for the various
flavours of ZIP compatible files.
Modifier and Type | Class and Description |
---|---|
protected static class |
Application.IllegalUsageException
Indicates illegal application parameters.
|
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 |
---|
Encrypt() |
Modifier and Type | Method and Description |
---|---|
static void |
main(String[] args)
Equivalent to
System.exit(new Encrypt().run(args)); . |
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 Encrypt().run(args));
.FsSyncException
protected int runChecked(String[] args) throws Application.IllegalUsageException, IOException
Avoid repeating this method and updating the same archive file upon each call! This would degrade the overall performance from O(n) to O(m*n), where m is the number of new or modified entries and n is the number of all entries in the archive file!
args
- an array of arguments for this command line utility.exit status
of the VM.Application.IllegalUsageException
IOException
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.