java check if directory exists

Java
Path path = ...;

if (Files.exists(path)) {
    // ...
}
Source

Also in Java: