private ResourceEvent toEvent( final Path path,
final ResourceChange change,
final WatchContext context ) {
if ( change instanceof ResourceUpdated ) {
return new ResourceUpdatedEvent( path, context.getMessage(), sessionInfo( context ) );
} else if ( change instanceof ResourceAdded ) {
return new ResourceAddedEvent( path, context.getMessage(), sessionInfo( context ) );
} else if ( change instanceof ResourceRenamed ) {
return new ResourceRenamedEvent( path, ( (ResourceRenamed) change ).getDestinationPath(), context.getMessage(), sessionInfo( context ) );
} else if ( change instanceof ResourceDeleted ) {