public void onFileChange ( File file ) { mojo . getLog ( ) . info ( EMPTY_STRING ) ; mojo . getLog ( ) . info ( "The watcher has detected a change in " + file . getAbsolutePath ( ) ) ; mojo . getLog ( ) . info ( EMPTY_STRING ) ; for ( Watcher watcher : watchers ) { if ( watcher . accept ( file ) ) { cleanupErrorFile ( watcher ) ; // This flag will be set to false if the processing must be interrupted. boolean continueProcessing ; try { continueProcessing = watcher . fileUpdated ( file ) ; } catch ( WatchingException e ) { //NOSONAR mojo . getLog ( ) . debug ( watcher + " has thrown an exception while handling the " + file . getName ( ) + EMPTY_STRING + " update" , e ) ; mojo . getLog ( ) . error ( String . format ( WATCHING_EXCEPTION_MESSAGE , e . getMessage ( ) ) ) ; createErrorFile ( watcher , e ) ; continueProcessing = false ; } if ( ! continueProcessing ) { break ; } } } mojo . getLog ( ) . info ( EMPTY_STRING ) ; mojo . getLog ( ) . info ( EMPTY_STRING ) ; }
The FAM has detected a change in a file . It dispatches this event to the watchers plugged on the current pipeline .