|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.chaosserver.bilbo.task.BaseTask
Base task that provides the template design pattern for concrete implementations.
Field Summary | |
protected static String |
DEFAULT_HELP
Holds the resource location of the default task help file. |
protected Settings |
settings
Holds the settings object. |
Constructor Summary | |
BaseTask()
|
Method Summary | |
void |
execute()
Executes this task against the rootDirectory provided in the settings object. |
protected abstract void |
execute(File currentDirectory)
Executes this task against the given directory |
protected void |
executeRecursive(File currentDirectory)
Executes this task against the given directory, then recursive against all subdirectories. |
protected String |
getHelpResource()
Gets the help resource location. |
protected Settings |
getSettings()
Getter for the settings object. |
void |
printHelp()
Prints the usage notes out for the concrete task. |
void |
setSettings(Settings settings)
Setter for the settings object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.chaosserver.bilbo.task.Task |
parseTaskArguments |
Field Detail |
protected static String DEFAULT_HELP
protected Settings settings
Constructor Detail |
public BaseTask()
Method Detail |
public void setSettings(Settings settings)
setSettings
in interface Task
settings
- the settings objectprotected Settings getSettings()
public void printHelp() throws TaskException
The concrete task should place it's usage notes in a file
named help.txt
inside its package. If
no file is found, then the default usage notes will be
displayed.
TaskException
- if there is an error printing
the usage notespublic void execute() throws TaskException
This task will at least be executed against the rootDirectory in the settings object. If the recursive flag is on, then it will also be executed against each subdirectory.
execute
in interface Task
TaskException
- if something goes wrongprotected void executeRecursive(File currentDirectory) throws TaskException
currentDirectory
- the directory to execute the task against
TaskException
- is something goes wrongprotected abstract void execute(File currentDirectory) throws TaskException
currentDirectory
- the directory to execute the task against
TaskException
- is something goes wrongprotected String getHelpResource()
This appends "help.txt" to the package location.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |