how to check if the directory is exists in or not in java code example Example: java check if directory exists Path path = ...; if (Files.exists(path)) { // ... }