private FileChangeWatcher newFileChangeWatcher(String fileLocation) throws IOException { if (fileLocation == null || fileLocation.isEmpty()) { return null; } final Path filePath = Paths.get(fileLocation).toAbsolutePath(); Path parentPath = filePath.getParent(); if (parentPath == null) { throw new IOException( "Key/trust store path does not have a parent: " + filePath); } return new FileChangeWatcher( parentPath, watchEvent -> { handleWatchEvent(filePath, watchEvent); }); }
try { final AtomicInteger callCount = new AtomicInteger(0); watcher = new FileChangeWatcher( tempDir.toPath(), event -> {
try { final List<WatchEvent<?>> events = new ArrayList<>(); watcher = new FileChangeWatcher( tempDir.toPath(), event -> {
try { final List<WatchEvent<?>> events = new ArrayList<>(); watcher = new FileChangeWatcher( tempDir.toPath(), event -> {
try { final List<WatchEvent<?>> events = new ArrayList<>(); watcher = new FileChangeWatcher( tempDir.toPath(), event -> {
try { final List<WatchEvent<?>> events = new ArrayList<>(); watcher = new FileChangeWatcher( tempDir.toPath(), event -> {