final Iterator<WatchEvent<?>> watchEventIterator = this.getWatchKey().pollEvents().iterator();
while (watchEventIterator.hasNext()) {
final WatchEvent<?> watchEvent = watchEventIterator.next();
if (StandardWatchEventKinds.ENTRY_CREATE == watchEvent.kind()) {
final CSVFeedService csvFeedService = CSVFeedService.getService(ServiceType.READER);
csvFeedService.setCSVFile(Paths.get(this.getDirectoryPath().toAbsolutePath().toString(),
(((WatchEvent<Path>) watchEvent).context().getFileName().toString())).toFile());
this.getReaderServices().add(this.executorService.submit(csvFeedService));
}
}
} catch (final DAOException exception) {