Read File
The Read File activity is a synchronous activity that is used to read a file and place its contents into the output of the activity.
General
The General tab has the following fields.
Field | Literal Value/Process Property/Module Property | Description |
---|---|---|
Name | None | The name to be displayed as the label for the activity in the process. |
Filename | Yes | The name of the file. |
Exclude File Content | None | Specifies not to load the data from this file into the output of the activity.
If selected, the contents of this file are not available to the subsequent activities in the process. |
Read as | Literal Value | This field is available only if the
Exclude File Content checkbox is not selected.
The type of the content in the file. It can be either Text or Binary. |
Include Timestamp | None | Select the checkbox to display timestamp, in addition to the date. |
Description
Provide a short description for the Read File activity.
Input
The following is the input of the activity.
Input Item | Datatype | Description |
---|---|---|
fileName | string | The name and path of the file to read. |
encoding | string | The character encoding of the text files.
This element is available only when the Read as field on the General tab is set to Text. You can specify the encoding names supported by Java in this element. If this element is not specified, the default encoding of the Java Virtual Machine used by the process engine is used. |
Output
The following is the output of the activity.
Output Item | Datatype | Description |
---|---|---|
fileInfo | complex | This element contains fullName, fileName, location, type, readProtected, writeProtected, size, and lastModified data. |
fullName | string | The name of the file with the path information. |
fileName | string | The name of the file without the path information. |
location | string | The path to the file. |
configuredFileName | string | An optional element. It is not populated by this activity. |
type | string | The file type. |
readProtected | boolean | Signifies whether the file or directory is protected from reading |
writeProtected | boolean | Signifies whether the file or directory is protected from writing |
size | integer | The size of the file in bytes. |
lastModified | string | The timestamp indicating when the file was last modified. |
fileContent | complex | The element containing the textContent data. |
textContent | string | The content of the file (text files), if the Exclude File Content check box is not selected on the General tab. |
binaryContent | binary | The content of the file (binary files), if the Exclude File Content check box is not selected on the General tab. Only available when Content as is set to Binary. |
encoding | string | The character encoding for the file when the value specified in the Read as field in the General tab is Text. |
Fault
The Fault tab lists the possible exceptions generated by this activity. For more information about error codes and the corrective action to take, see the TIBCO BusinessWorks Container Edition Error Codes guide.
Fault | Generated When.. |
---|---|
FileNotFoundException | The file does not exist. |
UnsupportedEncodingException | The content of the text file is invalid, and the content of the file is read into the process data. |
FileIOException | An input/output exception occurred when trying to read the file. |