uk.org.ogsadai.activity.files
Class FileAccessActivity
java.lang.Object
|
+--uk.org.ogsadai.activity.Activity
|
+--uk.org.ogsadai.activity.files.AbstractFileActivity
|
+--uk.org.ogsadai.activity.files.FileAccessActivity
- public class FileAccessActivity
- extends AbstractFileActivity
Reads a file or extracts part of a file. This file can be a text file or a binary file. For information on this activity see the OGSA-DAI user doc: OGSA-DAI/doc/interaction/activities/files/fileAccessActivity.html
- Author:
- The OGSA-DAI Team.
Field Summary |
private static java.lang.String |
COPYRIGHT_NOTICE
Copyright statement |
private static DAILogger |
LOG
Logger object for logging in this class |
private boolean |
mBase64encode
Is file content to be Base64 encoded (default false). |
private boolean |
mBinaryFile
Is the file a binary file (default true). |
private java.io.File |
mFile
The file to read from. |
private java.lang.String |
mFilename
The name of the file to read from |
private int |
mLength
Number of bytes/characters to read |
private int |
mOffset
Offset from start of file |
private BlockWriter |
mOutput
Activity output - file content |
Method Summary |
void |
initialise()
Gets the data resource accessor for the files data resource according to whether the users credentials permit this access. |
void |
processBlock()
Performs an iteration of the processing of an activity. |
Methods inherited from class uk.org.ogsadai.activity.Activity |
cleanUp, connectsTo, createOutputPipe, getActivityConfiguration, getActivityName, getCause, getName, getObservableStatus, getProperties, getSession, getStatus, hasActivityConfiguration, hasProperties, process, processFirst, setActivityName, setCompleted, setError |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
COPYRIGHT_NOTICE
private static final java.lang.String COPYRIGHT_NOTICE
-
Copyright statement
- See Also:
- Constant Field Values
LOG
private static final DAILogger LOG
-
Logger object for logging in this class
mFile
private java.io.File mFile
-
The file to read from.
mFilename
private java.lang.String mFilename
-
The name of the file to read from
mBase64encode
private boolean mBase64encode
-
Is file content to be Base64 encoded (default false).
mBinaryFile
private boolean mBinaryFile
-
Is the file a binary file (default true).
mOffset
private int mOffset
-
Offset from start of file
mLength
private int mLength
-
Number of bytes/characters to read
mOutput
private BlockWriter mOutput
-
Activity output - file content
FileAccessActivity
public FileAccessActivity(org.w3c.dom.Element element)
throws ActivitySpecificationException,
ActivityCreationException
initialise
public void initialise()
throws ActivitySpecificationException,
ActivityExecutionException
- Description copied from class:
AbstractFileActivity
-
Gets the data resource accessor for the files data resource according to whether the users credentials permit this access.
-
- Overrides:
initialise
in class AbstractFileActivity
-
- Throws:
ActivitySpecificationException
- If the user is not permitted to access the resource.
ActivityExecutionException
- If some internal problem occurs.
- See Also:
Activity.initialise()
processBlock
public void processBlock()
- Description copied from class:
Activity
-
Performs an iteration of the processing of an activity. This may involve reading a block of input data and writing a block of output data, or may involve some other kind of processing. When an activity is processed by the OGSA-DAI engine, this method will be invoked repeatedly until the activity either completes or stops due to an error or termination call. An implementation of this method should invoke the
setCompleted
method to indicate that processing is complete, or the setError
method if an error occurs that will prevent the processing from completing.
-
- Specified by:
processBlock
in class Activity
-