In addition to the field elements, the BatchLocalFile OTD’s Client node contains methods that extend the client interface functionality of the adapter. These methods are essential to the proper use of the OTD. These methods include:
get(): Retrieves a local file then stores its contents as a data payload. The method retrieves the first matching file based on the Target Directory Name and Target File Name parameters and stores the contents as a data payload (a byte array). It then performs any Post Transfer Command.
After this method call, you can get the payload’s contents through the method getPayload().
put(): Stores the data payload (as a byte array) to a file. It then performs any Post Transfer Command.
Before using this method call, you must set the file contents using the method setPayload().
The method throws an exception (LocalFileException) if an error occurs.
reset(): Allows you to return the Client node to its state immediately after the previous initialization.
The reset() method is available in both BatchFTP and BatchLocalFile OTDs. It must be called when the OTD has to be reused for another transfer during the same execution of executeBusinessRules() (for example, when you are using the Dynamic Configuration feature). The reset() method resets the content of the Client node without resetting the whole OTD.