|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.chaosserver.bilbo.task.BaseTask | +--net.chaosserver.bilbo.task.RecursiveTask | +--net.chaosserver.bilbo.task.RootFirstRecursiveTask | +--net.chaosserver.bilbo.task.generate.GenerateTask
Generates mappings files.
Field Summary | |
protected int |
errorLevel
Holds the error response if an error is encountered. |
protected boolean |
full
Holds the full flag. |
protected Collection |
mappings
Holds the mapping names to generate for each file. |
Fields inherited from class net.chaosserver.bilbo.task.BaseTask |
settings |
Constructor Summary | |
GenerateTask()
Default constructor. |
Method Summary | |
void |
execute(File currentDirectoryFile)
Iterators through each file in the directory and generates a mapping for each mapping passed in through the arguments. |
protected Directory |
generateDirectory(File currentDirectory)
Generates a directory object for the directory given. |
protected FilenameMapping |
generateFilenameMapping(Directory directory,
File currentFile)
Generates a filemapping for the given file. |
protected int |
getErrorLevel()
Getter for the error level |
protected boolean |
isFull()
Getter for the full property. |
protected void |
parseFlags(String flags)
Parses the flag portion of the task arguments. |
protected void |
parseMappingString(String mappingsString)
Parses the mapping portion of the task arguments. |
void |
parseTaskArguments(String argumentString)
Parses the argument string. |
protected void |
setErrorLevel(int errorLevel)
Setter for the error level |
protected void |
setFull(boolean full)
Setter for the full property. |
protected void |
writeMapping(File outputDirectory,
Directory directory)
Writes the mapping file out to the given directory. |
Methods inherited from class net.chaosserver.bilbo.task.RootFirstRecursiveTask |
executeRecursive |
Methods inherited from class net.chaosserver.bilbo.task.RecursiveTask |
executeSpecific, isRootDirectory |
Methods inherited from class net.chaosserver.bilbo.task.BaseTask |
execute, getHelpResource, getSettings, printHelp, setSettings |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected int errorLevel
protected boolean full
protected Collection mappings
Constructor Detail |
public GenerateTask()
Method Detail |
protected void setErrorLevel(int errorLevel)
errorLevel
- the error levelprotected int getErrorLevel()
protected void setFull(boolean full)
full
- the full propertyisFull()
protected boolean isFull()
setFull(boolean)
public void parseTaskArguments(String argumentString) throws BadTaskCommandArgumentsException
[-e#][-f] mapping1 [mapping2 [mapping3 [...]]]
parseTaskArguments
in interface Task
parseTaskArguments
in class BaseTask
argumentString
- the argument string to parse.
BadTaskCommandArgumentsException
- indicates a generic errorprotected void parseFlags(String flags)
flags
- the flag portion of the task argumentsprotected void parseMappingString(String mappingsString) throws BadTaskCommandArgumentsException
mappingsString
- the mapping portion of the task arguments
BadTaskCommandArgumentsException
- if there is an error
with the arguments providedpublic void execute(File currentDirectoryFile) throws GenerateException
execute
in class RecursiveTask
currentDirectoryFile
- the directory to process
GenerateException
- if there is an error generatingprotected Directory generateDirectory(File currentDirectory) throws GenerateException
currentDirectory
- the directory to generate a Directory object for
GenerateException
- indicates a generic errorprotected FilenameMapping generateFilenameMapping(Directory directory, File currentFile) throws GenerateException
directory
- the directory the file resides in. Needed in case
of name conflictscurrentFile
- the file to create mappings for
GenerateException
- indicates a generic errorprotected void writeMapping(File outputDirectory, Directory directory) throws GenerateException
outputDirectory
- the directory to write the mapping file to.directory
- directory to output
GenerateException
- indicates a generic error
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |