Tuesday, February 23, 2016

check if a file exists in Java

Use the following Code

Using java.io.File:
File f = new File(filePathString);
if(f.exists() && !f.isDirectory()) { 
    // do something
}
 
 
 
 
 

No comments:

Post a Comment