| /** |
| * |
| * Copyright (c) 2011, 2018 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) |
| * |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation |
| * |
| */ |
| package org.eclipse.osbp.xtext.signal.common; |
| |
| import java.io.IOException; |
| import java.nio.file.Path; |
| import java.nio.file.WatchEvent; |
| |
| public interface IOSBPSignalWatcher { |
| |
| /** |
| * Process all events for keys queued to the watcher. |
| */ |
| public void processEvents(); |
| |
| /** |
| * Handling method for the user to extend. |
| * @param ev the {@link WatchEvent} |
| */ |
| public void handleEvent(WatchEvent<Path> ev); |
| |
| |
| /** |
| * Register the given directory with the WatchService |
| * @param directory |
| * @throws IOException |
| */ |
| public void registerPathToWatcher(Path directory) throws IOException; |
| |
| /** |
| * Register the given directory, and all its sub-directories, with the WatchService. |
| * @param rootpath {@link Path} the root path. |
| * @throws IOException |
| */ |
| public void registerAll(Path rootpath) throws IOException; |
| |
| } |