|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.vt.middleware.crypt.AbstractCli
public abstract class AbstractCli
Abstract base class for all CLI handlers.
| Field Summary | |
|---|---|
protected static String |
BASE_64_ENCODING
Name of encoding option value for Base-64 encoding. |
protected static String |
HEX_ENCODING
Name of encoding option value for hexadecimal encoding. |
protected static String |
OPT_EXAMPLE
Example option. |
protected static String |
OPT_INFILE
Input file option. |
protected org.apache.commons.cli.Options |
options
Command line options. |
protected static String |
PEM_SUFFIX
Suffix of files using PEM encoding. |
| Constructor Summary | |
|---|---|
AbstractCli()
|
|
| Method Summary | |
|---|---|
protected void |
closeStream(InputStream in)
Attempts to close the given input stream. |
protected void |
closeStream(OutputStream out)
Attempts to close the given output stream. |
protected abstract void |
dispatch(org.apache.commons.cli.CommandLine line)
Dispatch command line data to the handler that can perform the operation requested on the command line. |
protected abstract String |
getCommandName()
Gets the name of the command for which this class provides a CLI interface. |
protected InputStream |
getInputStream(org.apache.commons.cli.CommandLine line)
Get an input stream containing data to be signed or verified based on CLI arguments. |
protected InputStream |
getInputStream(org.apache.commons.cli.CommandLine line,
String opt)
Get an input stream containing data to be signed or verified based on CLI arguments. |
protected void |
initOptions()
Initialize CLI options. |
void |
performAction(String[] args)
Parses command line options and invokes the proper handler to perform the requested action, or the default action if no action is specified. |
protected void |
printExamples()
Prints CLI usage examples. |
protected void |
printHelp()
Prints CLI help text. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final String OPT_INFILE
protected static final String OPT_EXAMPLE
protected static final String BASE_64_ENCODING
protected static final String HEX_ENCODING
protected static final String PEM_SUFFIX
protected final org.apache.commons.cli.Options options
| Constructor Detail |
|---|
public AbstractCli()
| Method Detail |
|---|
public final void performAction(String[] args)
args - Command line arguments.protected void initOptions()
protected abstract String getCommandName()
protected abstract void dispatch(org.apache.commons.cli.CommandLine line)
throws Exception
line - Parsed command line arguments container.
Exception - On errors thrown by handler.protected void printHelp()
protected void printExamples()
protected InputStream getInputStream(org.apache.commons.cli.CommandLine line)
throws IOException
line - Parsed command line arguments container.
IOException - On stream creation errors.
protected InputStream getInputStream(org.apache.commons.cli.CommandLine line,
String opt)
throws IOException
line - Parsed command line arguments container.opt - Name of command line option used to specify file input stream.
IOException - On stream creation errors.protected void closeStream(InputStream in)
in - Input stream to close.protected void closeStream(OutputStream out)
out - output stream to close.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||