Source:
<code>protected void doStart() throws Exception { super.doStart(); if (!Files.exists(baseDirectory)) { if (getEndpoint().isAutoCreate()) { baseDirectory = Files.createDirectories(baseDirectory); } else { <START> throw new RuntimeCamelException("Path must exists when autoCreate = false"); <END> } } if (!Files.isDirectory(baseDirectory)) { throw new RuntimeCamelException(String.format("Parameter path must be directory, %s given", baseDirectory.toString())); } DirectoryWatcher.Builder watcherBuilder = DirectoryWatcher.builder() .path(this.baseDirectory) .logger(log) .listener(new FileWatchDirectoryChangeListener()); if (!System.getProperty("os.name").toLowerCase().contains("mac")) { watcherBuilder.watchService(this.baseDirectory.getFileSystem().newWatchService()); } watcherBuilder.fileHashing(getEndpoint().isUseFileHashing()); if (getEndpoint().getFileHasher() != null && getEndpoint().isUseFileHashing()) { watcherBuilder.fileHasher(getEndpoint().getFileHasher()); } this.watcher = watcherBuilder.build(); watchDirExecutorService = getEndpoint().getCamelContext().getExecutorServiceManager() .newFixedThreadPool(this, "CamelFileWatchService", getEndpoint().getPollThreads()); pollExecutorService = getEndpoint().getCamelContext().getExecutorServiceManager() .newFixedThreadPool(this, "CamelFileWatchPoll", getEndpoint().getConcurrentConsumers()); for (int i = 0; i < getEndpoint().getPollThreads(); i++) { this.watcher.watchAsync(watchDirExecutorService); } for (int i = 0; i < getEndpoint().getConcurrentConsumers(); i++) { pollExecutorService.submit(new PollRunnable()); } }</code><technical_language>tend IllegalArgumentException for kind</technical_language>

Target:
protected void doStart() throws Exception { super.doStart(); if (!Files.exists(baseDirectory)) { if (getEndpoint().isAutoCreate()) { baseDirectory = Files.createDirectories(baseDirectory); } else { throw new IllegalArgumentException("Path must exists when autoCreate = false"); } } if (!Files.isDirectory(baseDirectory)) { throw new IllegalArgumentException(String.format("Parameter path must be directory, %s given", baseDirectory.toString())); } DirectoryWatcher.Builder watcherBuilder = DirectoryWatcher.builder() .path(this.baseDirectory) .logger(log) .listener(new FileWatchDirectoryChangeListener()); if (!System.getProperty("os.name").toLowerCase().contains("mac")) { watcherBuilder.watchService(this.baseDirectory.getFileSystem().newWatchService()); } watcherBuilder.fileHashing(getEndpoint().isUseFileHashing()); if (getEndpoint().getFileHasher() != null && getEndpoint().isUseFileHashing()) { watcherBuilder.fileHasher(getEndpoint().getFileHasher()); } this.watcher = watcherBuilder.build(); watchDirExecutorService = getEndpoint().getCamelContext().getExecutorServiceManager() .newFixedThreadPool(this, "CamelFileWatchService", getEndpoint().getPollThreads()); pollExecutorService = getEndpoint().getCamelContext().getExecutorServiceManager() .newFixedThreadPool(this, "CamelFileWatchPoll", getEndpoint().getConcurrentConsumers()); for (int i = 0; i < getEndpoint().getPollThreads(); i++) { this.watcher.watchAsync(watchDirExecutorService); } for (int i = 0; i < getEndpoint().getConcurrentConsumers(); i++) { pollExecutorService.submit(new PollRunnable()); } }