java check if directory exist code example Example: java check if directory exists Path path = ...; if (Files.exists(path)) { // ... }