uk.org.ogsadai.activity.files
Class DirectoryAccessActivity

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

public class DirectoryAccessActivity
extends AbstractFileActivity

An activity which returns a comma-separated list of the files contained within a directory.

Author:
The OGSA-DAI Project Team

Field Summary
 
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
DirectoryAccessActivity(org.w3c.dom.Element element)
          Construct the activity, passing the perform document to execute as a parameter.
 
Method Summary
 void initialise()
          Initialise the output of the activity.
 void processBlock()
          Spit out the names of the files contained within the directory onto the activity's output.
 
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, toString, wait, wait, wait
 

Constructor Detail

DirectoryAccessActivity

public DirectoryAccessActivity(org.w3c.dom.Element element)
                        throws ActivitySystemException,
                               ActivityUserException
Construct the activity, passing the perform document to execute as a parameter. In particular, we read the name of the directory which the user is trying to access.

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

public void initialise()
                throws ActivityUserException,
                       ActivitySystemException
Initialise the output of the activity.

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.

processBlock

public void processBlock()
Spit out the names of the files contained within the directory onto the activity's output. Each file is wrapped in <file></file> tags, each directory in <dir> tags.

Specified by:
processBlock in class Activity