cleanup resources

This commit is contained in:
eugenp 2017-09-26 01:00:09 +03:00
parent 8bf825d046
commit c9a754f0e4
1 changed files with 4 additions and 0 deletions

View File

@ -10,6 +10,7 @@ import java.nio.file.WatchKey;
import java.nio.file.WatchService;
public class DirectoryWatcherExample {
public static void main(String[] args) throws IOException, InterruptedException {
WatchService watchService = FileSystems.getDefault().newWatchService();
Path path = Paths.get(System.getProperty("user.home"));
@ -21,5 +22,8 @@ public class DirectoryWatcherExample {
}
key.reset();
}
watchService.close();
}
}