Check if directory exists in java



User Rating:  / 0
PoorBest 
Details

Simple java code for check if directory exist :

View source
package com.developerpages.snippets.core;
 
import java.io.File;
 
public class CheckIfDirectoryExists {
    
    public static void main(String[] args) {
        File dir = new File("directory");
        boolean exists = dir.exists();
        System.out.println("Directory " + dir.getPath() + " exists: " + exists);
    }
}
 


You have no rights to post comments

   

Login  

   

     

© Developerpages