Listing 1: CCOJASDirectoryWatcher.cfg
#
# DirectoryWatcherGateway configuration file
#
# The directory you want to watch. If you are entering a Windows path
# either use forward slashes (C:/mydir) or escape the back slashes (C:\\mydir).
directory=C:/CFusionMX7/wwwroot/ccojas
# Should we watch the directory and all subdirectories too
# Default is no. Set to 'yes' to do the recursion.
recurse=no
# The interval between checks, in miliseconds
# Default is 60 seconds
interval=5000
# The comma separated list of extensions to match.
# Default is * - all files
extensions=*
# CFC Function for file Change events
# Default is onChange, set to nothing if you don't want to see these events
changeFunction=onChange
# CFC Function for file Add events
# Default is onAdd, set to nothing if you don't want to see these events
addFunction=onAdd
# CFC Function for file Delete events
# Default is onDelete, set to nothing if you don't want to see these events
deleteFunction=onDelete
Listing 2: CCOJASDirectoryWatcher.cfc
<cfcomponent displayname="CCOJASDirectoryWatcher" output="no">
<cffunction name="onAdd" access="public" output="no">
<cfargument name="CFEvent" type="struct" returntype="void" required="yes"/>
<cfset data=CFEvent.data>
<cflog file="CCOJASDirectoryWatcher" application="No"
text="ACTION: #data.type#; FILE: #data.filename#; TIME:
#timeFormat(data.lastmodified)#">
</cffunction>
<cffunction name="onDelete" access="public" returntype="void" output="no">
<cfargument name="CFEvent" type="struct" required="yes"/>
<cfset data=CFEvent.data>
<cflog file="CCOJASDirectoryWatcher" application="No"
text="ACTION: #data.type#; FILE: #data.filename#">
</cffunction>
<cffunction name="onChange" access="public" returntype="void" output="no">
<cfargument name="CFEvent" type="struct" required="yes"/>
<cfset data=CFEvent.data>
<cflog file="CCOJASDirectoryWatcher" application="No"
text="ACTION: #data.type#; FILE: #data.filename#; TIME:
#timeFormat(data.lastmodified)#">
</cffunction>
</cfcomponent>