com.kirkwarez.wdysdv.batch
Class Task

java.lang.Object
  extended bycom.kirkwarez.wdysdv.batch.Task

public class Task
extends Object

The Task class is a class that represents a batchable task. Such an item has an input and output filename, a type (MYST V: EOA or Uru) and a mode (encrypt or * decrypt). It can be fed to a processor that will process this batch item (encrypt or decrypt the input file into the output file using the specified type of encryption).

Tasks are immutable, because the program doesn't edit them, but removes them and puts the data into the user's hands for reentry.

Since:
5.00
Version:
5.00
Author:
Berend "Kirk" Wouda

Field Summary
static int DECRYPT
          The decryption mode.
static int ENCRYPT
          The encryption mode.
static int EOA
          The MYST V: End of Ages encryption type.
protected  File input
          The input file.
protected  int mode
          The mode.
protected  File output
          The output file.
protected  int type
          The type of encryption.
static int URU
          The Uru encryption type.
 
Constructor Summary
Task(File input, File output, int type, int mode)
          Create a new task.
 
Method Summary
 File getInputFile()
          Returns the input file.
 int getMode()
          Returns the mode of operation, which is either ENCRYPT or DECRYPT.
 File getOutputFile()
          Returns the output file.
 int getType()
          Returns the type of encryption, which is either EOA or URU.
protected  void setInputFile(File input)
          Sets the input file to the given File.
protected  void setMode(int mode)
          Sets the mode of operation to either ENCRYPT or DECRYPT.
protected  void setOutputFile(File output)
          Sets the output file to the given File.
protected  void setType(int type)
          Sets the type of encryption, to either EOA or URU.
 String toString()
          Returns a string representation of this object, for use in the list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

input

protected File input
The input file.


output

protected File output
The output file.


type

protected int type
The type of encryption. This is either EOA or URU. End Of Ages uses AES ECB with an 128 bit key, Uru uses xTEA.


mode

protected int mode
The mode. This is either ENCRYPT or DECRYPT.


EOA

public static final int EOA
The MYST V: End of Ages encryption type.

See Also:
Constant Field Values

URU

public static final int URU
The Uru encryption type.

See Also:
Constant Field Values

ENCRYPT

public static final int ENCRYPT
The encryption mode.

See Also:
Constant Field Values

DECRYPT

public static final int DECRYPT
The decryption mode.

See Also:
Constant Field Values
Constructor Detail

Task

public Task(File input,
            File output,
            int type,
            int mode)
Create a new task.

Parameters:
input - The input File.
output - The output File.
type - The game type.
mode - The encryption mode.
Method Detail

getInputFile

public File getInputFile()
Returns the input file.

Returns:
The input file.

setInputFile

protected void setInputFile(File input)
Sets the input file to the given File. May not be null.

Parameters:
input - The input file.

getOutputFile

public File getOutputFile()
Returns the output file.

Returns:
The output file.

setOutputFile

protected void setOutputFile(File output)
Sets the output file to the given File.

Parameters:
output - The input file.

getType

public int getType()
Returns the type of encryption, which is either EOA or URU.

Returns:
The type of encryption.

setType

protected void setType(int type)
Sets the type of encryption, to either EOA or URU.

Parameters:
type - The type of encryption.

getMode

public int getMode()
Returns the mode of operation, which is either ENCRYPT or DECRYPT.

Returns:
The mode of operation.

setMode

protected void setMode(int mode)
Sets the mode of operation to either ENCRYPT or DECRYPT.

Parameters:
mode - The mode of operation.

toString

public String toString()
Returns a string representation of this object, for use in the list.

Returns:
What do you think, smartypants? :^P
See Also:
Object.toString()