@DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class) abstract class Application extends TApplication<RuntimeException>
| Modifier and Type | Class and Description |
|---|---|
protected static class |
Application.IllegalUsageException
Indicates illegal application parameters.
|
protected static class |
Application.ProgressMonitor
Monitors progress when committing unsynchronized changes to the
contents of archive files.
|
| Modifier and Type | Field and Description |
|---|---|
protected PrintStream |
err
The print stream for error output.
|
protected Application.ProgressMonitor |
monitor
A progress monitor for
TFile.umount(). |
protected PrintStream |
out
The print stream for standard output.
|
| Modifier | Constructor and Description |
|---|---|
protected |
Application()
Equivalent to
Application(System.out, System.err, true). |
protected |
Application(OutputStream out,
OutputStream err,
boolean autoFlush)
Constructs a new command line utility instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract int |
runChecked(String[] args)
Runs this command line utility.
|
protected void |
setup()
Runs the setup phase.
|
protected void |
sync() |
protected int |
work(String[] args)
Runs the work phase by calling
runChecked(java.lang.String[]). |
runprotected final PrintStream out
protected final PrintStream err
protected final Application.ProgressMonitor monitor
TFile.umount().protected Application()
Application(System.out, System.err, true).protected Application(OutputStream out, OutputStream err, boolean autoFlush)
Note that this constructor has side effects:
SampleManagerService class is set for
obtaining statistics when synchronizing any uncommitted changes to
the contents of archive files.
out - the standard output stream.err - the error output stream.autoFlush - if the output streams are not PrintStreams,
then they are wrapped in a new PrintStream with
this as the additional constructor parameter.protected void setup()
This method is run only once at the start of the life
cycle.
Its task is to configure the default behavior of the TrueZIP File* API
in order to answer the following questions:
The implementation in the class Application 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.
If this JVM is running in headless mode, then this configuration is
ignored and the user is prompted by the console I/O based prompting
key manager.
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 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[]).protected abstract int runChecked(String[] args) throws Exception
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 - on any exception.Exceptionprotected void sync()
throws FsSyncException
sync in class TApplication<RuntimeException>FsSyncExceptionCopyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.