net.chaosserver.bilbo.task
Class Settings

java.lang.Object
  |
  +--net.chaosserver.bilbo.task.Settings

public class Settings
extends Object

Holds the settings for the current execution of Bilbo.

Since:
Bilbo 1.0

Field Summary
protected  String fileMappingName
          Holds the name of the mapping file.
protected  boolean help
          Holds the help flag.
protected static Logger logger
          Holds the logger.
protected  boolean recursive
          Holds if the recursive flag.
protected  File rootDirectory
          Holds the root directory a task is being executing on.
protected  String taskArgs
          Holds the argument string being passed to the task.
protected  String taskName
          Holds the name of the task being executed.
protected  boolean verbose
          Holds the verbosity flag.
 
Constructor Summary
Settings()
          Default constructor.
 
Method Summary
protected  String generateArgString(String[] args)
          Converts the arguments array into a single string.
 String getFileMappingName()
          Getter for the file mapping name.
 File getRootDirectory()
          Getter for the root directory.
 String getTaskArgs()
          Getter for the task argument string.
 String getTaskName()
          Getter for the name of the task.
 boolean isHelp()
          Getter for the help property
 boolean isRecursive()
          Getter for the recursive flag.
 boolean isVerbose()
          Getter for the verbosity flag.
 void parseArguments(String[] args)
          Parses the argument string and sets the various properties.
protected  void parseMainArguments(String mainArgs)
          Parses the main arguments in the argument string.
 void setFileMappingName(String fileMappingName)
          Setter for the file mapping name.
protected  void setHelp(boolean help)
          Setter for the help property
protected  void setRecursive(boolean recursive)
          Setter for the recursive flag.
 void setRootDirectory(File rootDirectory)
          Setter for the root directory.
protected  void setTaskArgs(String taskArgs)
          Setter for the task argument string.
protected  void setTaskName(String taskName)
          Setter for the name of the task.
protected  void setVerbose(boolean verbose)
          Setter for the verbosity flag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static Logger logger
Holds the logger.


rootDirectory

protected File rootDirectory
Holds the root directory a task is being executing on.


verbose

protected boolean verbose
Holds the verbosity flag.


taskName

protected String taskName
Holds the name of the task being executed.


taskArgs

protected String taskArgs
Holds the argument string being passed to the task.


recursive

protected boolean recursive
Holds if the recursive flag.


fileMappingName

protected String fileMappingName
Holds the name of the mapping file.


help

protected boolean help
Holds the help flag.

Constructor Detail

Settings

public Settings()
Default constructor.

Method Detail

setTaskName

protected void setTaskName(String taskName)
Setter for the name of the task.

Parameters:
taskName - the name of the task.

getTaskName

public String getTaskName()
Getter for the name of the task.

Returns:
the name of the task.

setVerbose

protected void setVerbose(boolean verbose)
Setter for the verbosity flag.

Parameters:
verbose - if verbosity is on

isVerbose

public boolean isVerbose()
Getter for the verbosity flag.

Returns:
if verbosity is on

setRecursive

protected void setRecursive(boolean recursive)
Setter for the recursive flag.

Parameters:
recursive - value of the recursive flag

isRecursive

public boolean isRecursive()
Getter for the recursive flag.

Returns:
value of the recursive flag

setTaskArgs

protected void setTaskArgs(String taskArgs)
Setter for the task argument string.

Parameters:
taskArgs - the task argument string

getTaskArgs

public String getTaskArgs()
Getter for the task argument string.

Returns:
the task argument string

setRootDirectory

public void setRootDirectory(File rootDirectory)
Setter for the root directory.

Parameters:
rootDirectory - the root directory

getRootDirectory

public File getRootDirectory()
Getter for the root directory.

Returns:
the root directory

setFileMappingName

public void setFileMappingName(String fileMappingName)
Setter for the file mapping name.

Parameters:
fileMappingName - the file mapping name

getFileMappingName

public String getFileMappingName()
Getter for the file mapping name.

Returns:
the file mapping name

setHelp

protected void setHelp(boolean help)
Setter for the help property

Parameters:
help - the help property

isHelp

public boolean isHelp()
Getter for the help property

Returns:
the help property

parseArguments

public void parseArguments(String[] args)
                    throws BadCommandArgumentsException
Parses the argument string and sets the various properties. String should look like [main args] task-name [task args]

Parameters:
args - the array of command line arguments.
Throws:
BadCommandArgumentsException - indicates the arguments are not of valid format

parseMainArguments

protected void parseMainArguments(String mainArgs)
Parses the main arguments in the argument string.

Parameters:
mainArgs - Arguments appearing before the task name.

generateArgString

protected String generateArgString(String[] args)
Converts the arguments array into a single string.

Parameters:
args - The arguments array
Returns:
A string of the array.


Copyright © 20030415