code.dreamsense.com

Check if a file exists

public class Test {

  public static void main(String[] args) {
    File file = new File("Test");
    if (file.exists()) {
      System.out.println("File exists");
    }
  }
}

Kyle Eggleston
kyle@dreamsense.com
Copyright © 2003 - 2020