User Rating: / 0
Details
- Details
-
Category: Java
-
Created on Thursday, 15 November 2012 11:35
-
Last Updated on Thursday, 15 November 2012 11:35
-
Published on Thursday, 15 November 2012 11:35
-
Written by Administrator
-
Hits: 9395
Simple java code for check if directory exist :
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