com.chaosserver.bilbo.task.convert
Class ConvertTask

java.lang.Object
  |
  +--com.chaosserver.bilbo.task.BaseTask
        |
        +--com.chaosserver.bilbo.task.convert.ConvertTask
All Implemented Interfaces:
Task

public class ConvertTask
extends BaseTask

Tasked used to convert between two different mappings.

Since:
Bilbo 2.0

Field Summary
protected  int errorLevel
          Holds the error level.
protected  String fromStyle
          Holds the mapping style files start in.
protected  String toStyle
          Holds the mapping style files end in.
 
Fields inherited from class com.chaosserver.bilbo.task.BaseTask
DEFAULT_HELP, settings
 
Constructor Summary
ConvertTask()
           
 
Method Summary
 void execute(File currentDirectory)
          Swaps the files in the directory.
protected  int getErrorLevel()
          Getter for the errorLevel property.
protected  String getFromStyle()
          Getter for the fromStyle property.
protected  String getToStyle()
          Getter for the toStyle property.
protected  void parseFlags(String flags)
          Parses the task specific flags.
 void parseTaskArguments(String argumentString)
          Parses the task specific argument string.
protected  void setErrorLevel(int errorLevel)
          Setter for the errorLevel property.
protected  void setFromStyle(String fromStyle)
          Setter for the fromStyle property.
protected  void setToStyle(String toStyle)
          Setter for the toStyle property.
 
Methods inherited from class com.chaosserver.bilbo.task.BaseTask
execute, executeRecursive, getHelpResource, getSettings, printHelp, setSettings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fromStyle

protected String fromStyle
Holds the mapping style files start in.


toStyle

protected String toStyle
Holds the mapping style files end in.


errorLevel

protected int errorLevel
Holds the error level.

Constructor Detail

ConvertTask

public ConvertTask()
Method Detail

setFromStyle

protected void setFromStyle(String fromStyle)
Setter for the fromStyle property.

Parameters:
fromStyle - the fromStyle property

getFromStyle

protected String getFromStyle()
Getter for the fromStyle property.

Returns:
the fromStyle property

setToStyle

protected void setToStyle(String toStyle)
Setter for the toStyle property.

Parameters:
toStyle - the toStyle property

getToStyle

protected String getToStyle()
Getter for the toStyle property.

Returns:
the toStyle property

setErrorLevel

protected void setErrorLevel(int errorLevel)
Setter for the errorLevel property.

Parameters:
errorLevel - the errorLevel property

getErrorLevel

protected int getErrorLevel()
Getter for the errorLevel property.

Returns:
the errorLevel property

parseTaskArguments

public void parseTaskArguments(String argumentString)
                        throws BadTaskCommandArgumentsException
Description copied from interface: Task
Parses the task specific argument string.

Parameters:
argumentString - the task specific argument string
Throws:
BadTaskCommandArgumentsException - if the argument string is invalid

parseFlags

protected void parseFlags(String flags)
Parses the task specific flags.

Parameters:
flags - the task specific flags

execute

public void execute(File currentDirectory)
             throws ConvertException
Swaps the files in the directory.
  1. File the file name in the directory by fromStyle
  2. Rename the file in the directory to the toStyle

Specified by:
execute in class BaseTask
Parameters:
currentDirectory - the directory to execute against
Throws:
ConvertException - if something goes wrong


Copyright © 20020228