In this section:
Introduction
The File Transfer Listener monitors a specified local or shared directory. It detects new files in that directory and sends the content of those files as a request to the virtual asset that uses this listener. The virtual asset then passes the request to its responders. The matching responder provides a response for that request, then the File Transfer Listener writes the response to another directory. For example, this functionality could be used to simulate an application that listens to a file showing up within a specific directory, processes it, and then responds by placing a modified version of that file, or a different file, in another local or shared directory.
Requirements
- Virtualize 9.9.0 or later.
Installation
The listener can be installed from the UI or command line.
UI Installation
- Go to Parasoft > Preferences and click System Properties.
- Click Add JARs and select the filetransferlistener.jar file.
- Click Apply.
- Restart Virtualize.
Command Line Installation
Add the filetransferlistener.jar file to the system.properties.classpath
property in your settings properties file. For example:
system.properties.classpath=<PATH_TO_JAR>/filetransferlistener.jar
Usage
After installation, the File Transfer Listener will be available in the Transports > Custom tab of the Virtual Asset configuration panel. Double-click a virtual asset’s Virtualize Server node to open this panel.
If multiple custom listeners are available, you can select the one you want to use from the Select Implementation menu.
You can configure correlations, transformations, responses, and so on in the responders associated with the virtual asset.
Configuration
You configure the listener using the following options.
Source Directory | Specify which local or shared directory you want to monitor for new files. You can enter an absolute path, a relative path (in relation to the |
---|---|
Source Encoding | Specify the character encoding for the contents of the source file. The system default is used if this option is not specified. If the source file contains a recognized BOM (UTF-8, UTF-16BE, UTF-16LE, UTF-32BE, UTF-32LE), it will be used to determine the character encoding. |
Target Directory | Specify the local or shared directory to which you want files transferred. You can enter an absolute path, a relative path (in relation to the VirtualAssets project), or a directory (for example, \\file.parasoft.com\Development\tmp\user\OUT ). |
Target File Name | Specify the desired name for the transferred file. You can use variables such as %d (current date) %t (current time), %b (base filename without extension), and %e (extension). If this field is empty, the original file name will be used. |
Poll Interval | Specify how frequently you want to check the specified directory. The default is 1000 milliseconds. |
Log Level | Specify how much information you want logged to the console and the Event Monitoring view. The default is 2 (warn). |
Third-Party Content
This extension includes items that have been sourced from third parties as outlined below.
- Commons IO (Apache license)
Additional license details are available in this plugin's licenses folder.