T
- The class containing the parsed command line arguments for the
command.public abstract class AbstractStreamCompressionProgram<T extends StreamCompressionProgramArguments> extends AbstractProgram
Constructor and Description |
---|
AbstractStreamCompressionProgram() |
Modifier and Type | Method and Description |
---|---|
protected abstract InputStream |
createInputStream(int sourceNo,
T settings)
Create an input stream on the source entity for the given command line
arguments.
|
protected abstract OutputStream |
createOutputStream(int targetNo,
T settings)
Create an output stream on the target entity for the given command line
arguments.
|
protected abstract T |
parseCommandLine(String[] args)
Subclasses implement this to parse their command line.
|
protected void |
postProcess(int sourceNo,
T settings)
Subclasses may override this for postprocessing the source and/or target
entity.
|
protected void |
run(String[] args) |
getArg, getParentLocation, isFlagArgument
protected abstract T parseCommandLine(String[] args) throws CommandErrorException
args
- The command line arguments, unparsed.CommandErrorException
- If the commands were invalid.protected abstract InputStream createInputStream(int sourceNo, T settings) throws IOException, IgnoreFileException
sourceNo
- The index number for the source entity. The first source
has index == 0.settings
- The command line arguments.IOException
- On I/O errors.IgnoreFileException
- If the file should be ignored for some
reason.protected abstract OutputStream createOutputStream(int targetNo, T settings) throws IOException, IgnoreFileException
targetNo
- The index number for the target entity. The first target
has index == 0.settings
- The command line arguments.IOException
- On I/O errors.IgnoreFileException
- If the file should be ignored for some
reason.protected void postProcess(int sourceNo, T settings) throws IOException
sourceNo
- The index number for the source and target entities.settings
- The command line arguments.IOException
- On I/O errors.protected void run(String[] args) throws CommandErrorException, IOException
CommandErrorException
IOException