protected void loopImpl(WatchService watcher) {
		WatchKey key = watcher.poll();
		
		if(key != null) {					
			for(WatchEvent<?> event: key.pollEvents()) {
				
				@SuppressWarnings("unchecked")
				WatchEvent<Path> pathEvent = (WatchEvent<Path>) event;
	
				Kind<?> kind = event.kind();
				Path path = pathEvent.context();
				
				DetectionType type = null;
				if(kind == StandardWatchEventKinds.ENTRY_CREATE) {
					type = DetectionType.CREATE;
				} else if (kind == StandardWatchEventKinds.ENTRY_DELETE) {
					type = DetectionType.DELETE;
				}
	
				if(type != null) {
					detectedFile(type, path.toFile());
				}
			}
			key.reset();
		}
	}