uk.org.ogsadai.activity.files
Class FileManipulationActivity

java.lang.Object
  |
  +--uk.org.ogsadai.engine.Activity
        |
        +--uk.org.ogsadai.activity.files.AbstractFileActivity
              |
              +--uk.org.ogsadai.activity.files.FileManipulationActivity

public class FileManipulationActivity
extends AbstractFileActivity

An activity which provides the means by which to move, copy, create and delete files from the filesystem on the GDS.

Author:
The OGSA-DAI Project Team

Field Summary
static int COPY
          Indicates an action to copy a file.
static int CREATE
          Indicates an action to create a new file.
static int DELETE
          Indicates an action to delete a file.
static int MOVE
          Indicates an action to move a file.
static int NONE
          Indicates lack of declaration about which action to perform.
 
Fields inherited from class uk.org.ogsadai.activity.files.AbstractFileActivity
mConnectionManager, mTopDir
 
Fields inherited from class uk.org.ogsadai.engine.Activity
mContext, mExternalInputs, mExternalOutputs, mInternalInputs, mInternalOutputs
 
Constructor Summary
FileManipulationActivity(org.w3c.dom.Element element)
          Construct the activity, passing the perform document to execute as a parameter.
 
Method Summary
protected  void initialise()
          Perform some checks on the connection managers's configuration, including whether the connection manager is a FileSystemConnectionManager and the top-level directory exists and really is a directory.
 void processBlock()
          Perform the desired action.
 java.lang.String toString()
          Return a string representation of the action to be performed.
 
Methods inherited from class uk.org.ogsadai.engine.Activity
cleanUp, connectsTo, getActivityConfiguration, getName, getObservableStatus, getProperties, getStatus, hasActivityConfiguration, hasProperties, processFirst, setCompleted, setError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NONE

public static final int NONE
Indicates lack of declaration about which action to perform.

See Also:
Constant Field Values

MOVE

public static final int MOVE
Indicates an action to move a file.

See Also:
Constant Field Values

COPY

public static final int COPY
Indicates an action to copy a file.

See Also:
Constant Field Values

CREATE

public static final int CREATE
Indicates an action to create a new file.

See Also:
Constant Field Values

DELETE

public static final int DELETE
Indicates an action to delete a file.

See Also:
Constant Field Values
Constructor Detail

FileManipulationActivity

public FileManipulationActivity(org.w3c.dom.Element element)
                         throws ActivitySystemException,
                                ActivityUserException
Construct the activity, passing the perform document to execute as a parameter. In particular, we interpret what action the user has specified to perform.

Parameters:
element - the perform document
Throws:
ActivitySystemException - if the activity caused a problem
ActivityUserException - if the user tried to do something naughty
Method Detail

initialise

protected void initialise()
                   throws ActivitySystemException,
                          ActivityUserException
Description copied from class: AbstractFileActivity
Perform some checks on the connection managers's configuration, including whether the connection manager is a FileSystemConnectionManager and the top-level directory exists and really is a directory. It exposes this directory in the protected field mTopDir which sub-classes should use in order to obtain the context within which their file access may occur.

Sub-classes may override this method if they want to perform additional initialisation, but should call super.initialise() to ensure that the checks contained here are executed.

Overrides:
initialise in class AbstractFileActivity
Throws:
ActivityUserException - If there is a user problem intialising the activity, like the top-level directory specified in the connection configuration does not exist.
ActivitySystemException - If there is a problem intialising the activity, like not using the FileSystemConnectionManager connection manager.

toString

public java.lang.String toString()
Return a string representation of the action to be performed.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the action

processBlock

public void processBlock()
Perform the desired action.

Specified by:
processBlock in class Activity