de.schlichtherle
Class Encrypt

java.lang.Object
  extended by de.schlichtherle.Encrypt
Direct Known Subclasses:
encrypt

public class Encrypt
extends Object

Encrypts the contents of the file provided as the first argument into the RAES file provided as the second argument for the main method.

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.

Since:
TrueZIP 6.5
Version:
TrueZIP 6.7
Author:
Christian Schlichtherle

Nested Class Summary
protected static class de.schlichtherle.CommandLineUtility.ProgressMonitor
           
 class Encrypt.IllegalUsageException
           
 
Field Summary
protected  PrintStream err
          The print stream for error output.
protected  PrintStream out
          The print stream for standard output.
protected  de.schlichtherle.CommandLineUtility.ProgressMonitor progressMonitor
          The command line progress monitor.
 
Constructor Summary
Encrypt()
           
Encrypt(OutputStream out, OutputStream err, boolean autoFlush)
           
 
Method Summary
static void main(String[] args)
          Equivalent to System.exit(new Encrypt().run(args));.
 int run(String[] args)
          Runs this command line utility.
 boolean runWithException(String[] args)
          Runs this command line utility.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

out

protected final PrintStream out
The print stream for standard output.


err

protected final PrintStream err
The print stream for error output.


progressMonitor

protected final de.schlichtherle.CommandLineUtility.ProgressMonitor progressMonitor
The command line progress monitor.

Constructor Detail

Encrypt

public Encrypt()

Encrypt

public Encrypt(OutputStream out,
               OutputStream err,
               boolean autoFlush)
Method Detail

main

public static void main(String[] args)
Equivalent to System.exit(new Encrypt().run(args));.


runWithException

public boolean runWithException(String[] args)
                         throws Encrypt.IllegalUsageException,
                                IOException
Runs this command line utility. Throws an exception if an error occurs.

Parameters:
args - A non-empty array of Unix-like commands and optional parameters.
Returns:
false iff the command is a test which fails, true otherwise.
Throws:
IOException - On any I/O related exception.
Encrypt.IllegalUsageException

run

public final int run(String[] args)
Runs this command line utility. Prints a user readable error message to the error output stream which was provided to the constructor if an error occurs.

Parameters:
args - A non-empty array of Unix-like commands and optional parameters.
Returns:
1 iff the command fails, 0 otherwise.