java check if file exists

Java
import java.io.File;

File tmpDir = new File("/var/tmp");
boolean exists = tmpDir.exists();
Source

Also in Java: