Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 1278

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Using External Resources
Property
Req/Opt
Required
directory
recurse
Optional
Optional
extensions
interval
Optional
Optional
addFunction
changeFunction
Optional
Optional
deleteFunction
An example configuration file is located in the gateway\config\directory-watcher.cfg file.
CFC methods
When the directory contents change, the event gateway calls one of the following CFC listener methods, unless you
change the names in the configuration file:
onAdd
onChange
onDelete
The CFEvent.Data field sent to the listener methods includes the following fields:
Field
Description
TYPE
Event type, one of ADD, CHANGE, DELETE.
FILENAME
Absolute path from the system directory root to the file that was added, deleted, or changed.
LASTMODIFIED
The date and time that the file was created or modified. This field is not included if the file was deleted.
The event gateway supports multiple listener CFCs and sends the event messages to all listeners. The event gateway is
one way; it watches for events and dispatches event information to a CFC, but it does not accept return values from
the CFC or input from
SendGatewayMessage
The directory watcher logs errors to the watcher.log file in the ColdFusion logs directory.
Example DirectoryWatcher application
The following code shows a simple directory watcher application. It enters a line in a log file each time a file is added,
deleted, or changed in the directory specified in the configuration file. ColdFusion includes the date and time that a
log entry is made. However, if the directory watcher monitors changes infrequently, for example once every minute or
more, the time in the log entry could differ from the time a file was added or changed, so the information includes the
time (but not date) for these actions.
Description
Path to the directory to watch.
Whether to check subdirectories. The default value is
Comma-delimited list of extensions to watch. The event gateway logs only changed files with these
extensions. An asterisk (*) indicates all files. The default value is all files.
Number of milliseconds between the times that the event gateway checks the directory. The
default value is 60 seconds.
Name of the function to call when a file is added. The default value is
Name of the function to call when a file is changed. The default value is
Name of the function to call when a file is deleted. The default value is
functions.
Last updated 1/20/2012
no
.
.
onAdd
onChange
.
.
onDelete
1273

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents