Tuesday, August 31, 2010

Article | Java To Determine if a File or Directory Exists



  1. import java.io.*;

  2. public class filedirexists{

  3. public static void main(String args[])

  4. {

  5. File filedir=new File("File or Directory exists or not!!")

  6. boolean exists = filedir.exists()

  7. if (!exists)

  8. {

  9. System.out.println("The File/Directory you are looking for is not found")

  10. }

  11. else

  12. {

  13. System.out.println("The File/Directory you are looking for available");

  14. }

  15. }

  16. }

Loading...

Comments :

0 comments to “ Java To Determine if a File or Directory Exists ”

Top Views

BloggerTipsTemplates

CHICKLETS

Enter your email address:

Delivered by FeedBurner

Followers