public void watch(String dirPath) {

		Path dirToMonitor = Paths.get(dirPath);

		try {
			watcher = dirToMonitor.getFileSystem().newWatchService();

			// Register create, modify and delete watchers
			dirToMonitor.register(watcher,
					StandardWatchEventKinds.ENTRY_CREATE,
					StandardWatchEventKinds.ENTRY_DELETE,
					StandardWatchEventKinds.ENTRY_MODIFY);

			while (watcher != null) {
				// Retrieve key
				WatchKey key = watcher.take();

				// Process events
				for (WatchEvent<?> event : key.pollEvents()) {
					if (event.kind() == StandardWatchEventKinds.ENTRY_CREATE) {
						logger.info("Created: " + event.context().toString());
						changeEvent.fileCreated(dirPath
								+ event.context().toString());
					} else if (event.kind() == StandardWatchEventKinds.ENTRY_DELETE) {
						logger.info("Delete: " + event.context().toString());
						changeEvent.fileRemoved(dirPath
								+ event.context().toString());
					} else if (event.kind() == StandardWatchEventKinds.ENTRY_MODIFY) {
						logger.info("Modify: " + event.context().toString());
						changeEvent.fileModified(dirPath
								+ event.context().toString());
					} else if (event.kind() == StandardWatchEventKinds.OVERFLOW) {
						logger.error("WatchService overflow. Some changes might have been lost.");
						// TODO: Handle this to re-initialize the service
						// repository from serviceConfig
					}
				}

				// Reset the key
				boolean valid = key.reset();
				if (!valid) {
					logger.info("Invalid WatchKey. Exiting the loop.");
					break;
				}
			}

		} catch (Exception e) {
			logger.error("An error occurred while watching directory: "
					+ dirPath, e);
		}
	}