Developing Apama Applications > Developing Apama Applications in Event Modeler > Using Standard Blocks > The Utility blocks > File Reader v2.0
File Reader v2.0
The File Reader lets a scenario read a line at a time from a specified file using the File adapter with the JMultiFileTransport transport layer and the JNullCodec codec plug-in.
For details about using the File adapter, see Developing Adapters, .
The same File Reader block can read from multiple files.
Parameters
Parameter
Description
Transport Name
The name of the instance of the JMultiFileTransport to use. This must match a transport instance name specified in the IAF configuration file.
File Name
The name of the file to read.
Lines In Header
The number of lines to skip at the beginning of the file.
File Channel
The name of the channel to output file events to. The various file events are defined in the FileEvents.mon file, and the definitions are in the com.apama.file package. You can find FileEvents.mon in the adapters/monitors directory of your Apama installation directory.
Operations
Operation
Description
Open File
Opens a file according to the current values of the Transport Name, File Name, Lines In Header and File Channel parameters
Close File
Closes a file according to the current values of the Transport Name, File Name and File Channel parameters.
Read Line
Reads a line from the file. Uses the current values of the Transport Name, File Name and File Channel parameters.
Get File Status
Explicit call to update the Status output feed. Uses the current values of the Transport Name, File Name and File Channel parameters.
Input feeds
This block has no input feeds.
Output feeds
Feed
Field
Description
line
file name
The name of the file associated with the current line.
file transport
The name of the transport associated with the current line.
line
String that contains the current read line.
error
file name
The name of the file that returned the error.
file transport
The name of the transport that returned the error.
message
The error message returned.
status
file name
The name of the file associated with the status update.
file transport
The name of the transport associated with the status update.
more available
A flag that indicates whether there are currently more lines to read from the file.
file currently open
A flag that indicates whether or not the file is currently open.
Copyright © Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its Subsidiaries and or/its Affiliates and/or their licensors.
Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG.