Activity - fileAccessActivity
Activity Type: File
Description
Access the contents of a file.
Examples
<fileAccessActivity name="readBytesActivity">
<file>some/file.ext</file>
<bytes offset="3" length="9"/>
<output name="fileBytesAccessOutput" base64encode="false"/>
</fileAccessActivity>
<fileAccessActivity name="readLinesActivity">
<file>some/file.ext</file>
<lines offset="2" length="5"/>
<output name="fileLinesAccessOutput" base64encode="true"/>
</fileAccessActivity>
Specification
Element fileAccessActivity:
-
Attribute name - unique name for the
activity within the scope of a request.
-
Element file (required) -
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).
Input and Output Types
- Output: output:
- java.lang.String (could be base64 encoded)
- byte[]
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.
Data Resource Accessor
This activity requires a data resource accessor that implements the following
interface:
uk.org.ogsadai.dataresource.FileAccessProvider
XML Schema
OGSA-DAI/schema/ogsadai/xsd/activities/file_access.xsd
Class
uk.org.ogsadai.activity.files.FileAccessActivity
Client Toolkit Class
None at present.