@Test void testListenToRelativePath() throws IOException { listener.listenToFile(Paths.get("testfile.conf"), event -> {}).dispose(); }
public Disposable listenToFile(Path file, final Subscriber<WatchEvent<?>> callback) throws IOException, IllegalArgumentException { file = file.toAbsolutePath(); if (Files.isDirectory(file)) { throw new IllegalArgumentException("Path " + file + " must be a file"); } final Path fileName = file.getFileName(); return getRegistration(file.getParent()).subscribe(fileName, callback); }
WatchServiceListener implements AutoCloseable { public Disposable listenToFile(Path file, final Subscriber<WatchEvent<?>> callback) throws IOException, IllegalArgumentException { file = file.toAbsolutePath(); if (Files.isDirectory(file)) { throw new IllegalArgumentException("Path " + file + " must be a file"); } final Path fileName = file.getFileName(); return getRegistration(file.getParent()).subscribe(fileName, callback); } }
WatchServiceListener implements AutoCloseable { public Disposable listenToFile(Path file, final Subscriber<WatchEvent<?>> callback) throws IOException, IllegalArgumentException { file = file.toAbsolutePath(); if (Files.isDirectory(file)) { throw new IllegalArgumentException("Path " + file + " must be a file"); } final Path fileName = file.getFileName(); return getRegistration(file.getParent()).subscribe(fileName, callback); } private  WatchServiceListener(final ThreadFactory factory, final FileSystem fileSystem, final Executor taskExecutor); }
WatchServiceListener implements AutoCloseable { public Disposable listenToFile(Path file, final Subscriber<WatchEvent<?>> callback) throws IOException, IllegalArgumentException { file = file.toAbsolutePath(); if (Files.isDirectory(file)) { throw new IllegalArgumentException("Path " + file + " must be a file"); } final Path fileName = file.getFileName(); return getRegistration(file.getParent()).subscribe(fileName, callback); } private  WatchServiceListener(final ThreadFactory factory, final FileSystem fileSystem, final Executor taskExecutor); static Builder builder(); static WatchServiceListener create(); Disposable listenToFile(Path file, final Subscriber<WatchEvent<?>> callback); Disposable listenToDirectory(Path directory, final Subscriber<WatchEvent<?>> callback); ConfigurationReference<N> listenToConfiguration(final Function<Path, ConfigurationLoader<? extends N>> loaderFunc, final Path path); @Override void close(); }
WatchServiceListener implements AutoCloseable { public Disposable listenToFile(Path file, final Subscriber<WatchEvent<?>> callback) throws IOException, IllegalArgumentException { file = file.toAbsolutePath(); if (Files.isDirectory(file)) { throw new IllegalArgumentException("Path " + file + " must be a file"); } final Path fileName = file.getFileName(); return getRegistration(file.getParent()).subscribe(fileName, callback); } private  WatchServiceListener(final ThreadFactory factory, final FileSystem fileSystem, final Executor taskExecutor); static Builder builder(); static WatchServiceListener create(); Disposable listenToFile(Path file, final Subscriber<WatchEvent<?>> callback); Disposable listenToDirectory(Path directory, final Subscriber<WatchEvent<?>> callback); ConfigurationReference<N> listenToConfiguration(final Function<Path, ConfigurationLoader<? extends N>> loaderFunc, final Path path); @Override void close();  }