Activity - readFile
Activity Type: Indexed File
Description
Read the contents of a file.
Examples
<readFile name="read">
<file>some/file.ext</file>
<bytes offset="3" length="9"/>
<output name="fileAccessOutput" base64encode="false"/>
</readFile>
<readFile name="read">
<file>some/file.ext</file>
<lines offset="2" length="5"/>
<output name="fileAccessOutput" base64encode="true"/>
</readFile>
<readFile name="read">
<fromLocal from="searchOutput"/>
<output name="fileAccessOutput" base64encode="true"/>
</readFile>
Specification
Element readFile:
-
Attribute name - unique name for the
activity.
-
One of the following element groups, either:
-
Element fromLocal -
refers to the output stream of another activity.
-
Attribute from - name of an input stream
providing the data to deliver.
-
Or:
-
Element file -
contains the path to the file to access. This path should be
relative to the top-level directory exposed by the associated
OGSA-DAI service and must not attempt to traverse up the directory
hierarchy higher than this directory.
-
One of the following two elements (required):
-
Element bytes - access the
contents of a file on a byte-by-byte basis.
-
Attribute offset - index of first byte to
access.
-
Attribute length - number of bytes to
access.
-
Element lines - access the
contents of a file on a line-by-line basis.
-
Attribute offset - index of first line to
access.
-
Attribute length - number of lines to
access.
-
output (required) - output
stream.
-
Attribute name - name of the activity's
output stream.
-
Attribute base64encode - flag indicating
whether the output will be base64 encoded (true) or not (false).
Warning to Service Deployers
This activity can be used by clients to potentially access
any directory on your server below
that exposed by the associated OGSA-DAI service.
XML Schema
OGSA-DAI/schema/ogsadai/xsd/activities/file_reading.xsd
Implementation
OGSA-DAI/src/java/activities/uk/org/ogsadai/activity/indexedfiles/FileReadingActivity.java