return context.getMessage();
}
private <T extends ResourceEvent> Pair<Path, T> buildEvent( final Class<T> clazz,
final WatchEvent<?> event ) {
final WatchContext context = (WatchContext) event.context();
final Path _affectedPath;
final T result;
if ( event.kind().equals( StandardWatchEventKind.ENTRY_MODIFY ) ) {
_affectedPath = convert( context.getOldPath() );
result = (T) new ResourceUpdatedEvent( _affectedPath, context.getMessage(), sessionInfo( context ) );
} else if ( event.kind().equals( StandardWatchEventKind.ENTRY_CREATE ) ) {
_affectedPath = convert( context.getPath() );
result = (T) new ResourceAddedEvent( _affectedPath, context.getMessage(), sessionInfo( context ) );
} else if ( event.kind().equals( StandardWatchEventKind.ENTRY_RENAME ) ) {
_affectedPath = convert( context.getOldPath() );
result = (T) new ResourceRenamedEvent( _affectedPath, convert( context.getPath() ), context.getMessage(), sessionInfo( context ) );
} else if ( event.kind().equals( StandardWatchEventKind.ENTRY_DELETE ) ) {
_affectedPath = convert( context.getOldPath() );
result = (T) new ResourceDeletedEvent( _affectedPath, context.getMessage(), sessionInfo( context ) );
} else {
_affectedPath = null;
result = null;
}
if ( _affectedPath == null ) {