Saturday, June 27, 2009

How to Determine If a File or Directory Exists


boolean existsFlag = (new File("C:/temp/temp.txt")).exists();
if (existsFlag) {
// File or directory exists
} else {
// File or directory does not exist
}

0 comments:

 

Sample Java Codes Copyright © 2008 Green Scrapbook Diary Designed by SimplyWP | Made free by Scrapbooking Software | Bloggerized by Ipiet Notez