|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.edg.data.util.CommandConfiguration
Encapsulates the configuration file for a command. Currently this usesa properties file
Constructor Summary | |
CommandConfiguration(java.lang.String configResource)
create a new configuratio object |
Method Summary | |
org.edg.data.util.CommandDescriptor |
getCommandDescriptor(java.lang.String command)
Take a possible command name or shortcut, and return the actual command name it maps to. |
java.lang.String |
getProgramName()
the program name that is being run |
java.lang.String |
getProperty(java.lang.String key)
Deprecated. Get a property from the configuration resource specified in the constructor, throwing an exception if it is not found. |
void |
printHelp(boolean withCommandList,
org.apache.commons.cli.Options opts,
java.io.PrintStream output)
Print the usage message on the screen, with additional help on the list of available commands if requested with the -h option. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CommandConfiguration(java.lang.String configResource) throws InvalidConfigurationException, java.io.FileNotFoundException
configResource
- the resource on the classpath from which to
read our configuration
InvalidConfigurationException
- if a problem
java.io.FileNotFoundException
Method Detail |
public java.lang.String getProgramName()
public java.lang.String getProperty(java.lang.String key) throws InvalidConfigurationException
key
- the key
InvalidConfigurationException
- if the key is not found in the file.public org.edg.data.util.CommandDescriptor getCommandDescriptor(java.lang.String command)
command
- the command or shortcut to check
null
if the
command is not found in the configuration objectpublic void printHelp(boolean withCommandList, org.apache.commons.cli.Options opts, java.io.PrintStream output) throws InvalidConfigurationException
withCommandList
- opts
- output
-
InvalidConfigurationException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |