Eulalia
0
Q:

java check if file exists

// Get the file 
File f = new File("F:\\program.txt"); 

// Check if the specified file 
// Exists or not 
if (f.exists()) 
  System.out.println("Exists"); 
else
  System.out.println("Does not Exists"); 
2
File tempFile = new File("c:/temp/temp.txt");
boolean exists = tempFile.exists();
1
import java.io.File;

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

New to Communities?

Join the community