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
}
 
 
 
 
 
check if a file exists in Java check if a file exists in Java Reviewed by (C#) Csharp examples on 7:38 PM Rating: 5

No comments:

Facebook

Powered by Blogger.