File Event Listeners (remote and local)

Local file-system changes: Since 1.3

Remote file-system changes: Since 4.2

File Event Listeners allow you to monitor changes on a specific local file system path or remote URL – for example, new files appearing in a folder – and react to such an event with a predefined task.

You can either specify an exact file name or use a wildcard or regexp, then set a checking interval in seconds, and finally, define a task to process the event.

There is a global minimum check interval that you can change if necessary in the configuration ("clover.event.fileCheckMinInterval" property). See Chapter 9, List of Properties.

Web GUI - creating a File Event listener

Figure 24.8. Web GUI - creating a File Event listener


Table 24.8. Parameters passed from the listener to the task

ParameterDescription
EVENT_USERNAMEUsername of the user who caused the event.
EVENT_USER_IDNumeric ID of the user who caused the event.
EVENT_FILE_NAMEName of the file (without path or URL) that triggered the event. Present only when "Trigger one task for multiple changed files" is disabled.
EVENT_FILE_PATHResolved (without placeholders) path to the observed directory on the local filesystem. Valid only for a local file listener.
EVENT_FILE_PATTERNFilename pattern.
EVENT_FILE_EVENT_TYPEType of the file event. Possible values: SIZE, CHANGE_TIME, APPEARANCE, DISAPPEARANCE.
EVENT_FILE_LISTENER_IDID of the listener which triggered the event.
EVENT_FILE_URLSFull URLs to access the files, e.g. in the File URL attribute of components. If "Trigger one task for multiple changed files" is enabled and there are multiple URLs, they are separated by a separator specified by CloverETL Engine property DEFAULT_PATH_SEPARATOR_REGEX.
EVENT_FILE_AUTH_USERNAME Username/ID to the remote location
EVENT_FILE_AUTH_USERNAME_URL_ENCODED The same as EVENT_FILE_AUTH_USERNAME, but the value is also URL encoded, so it may be used in a URL.
EVENT_FILE_AUTH_PASSWORD Password/key to the remote location. It is encrypted by the master password.
EVENT_FILE_AUTH_PASSWORD_URL_ENCODED The same as EVENT_FILE_AUTH_PASSWORD, but the value is also URL encoded, so it may be used in a URL.