• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

find whether the folder exists or not

 
Madhu Sudhana
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can we find that

a floder exists or not in a particular location?

ex:

c:\folder1

I have to search folder1 exists in c:\ or not

let me know if any body has the answer??
 
Edwin Dalorzo
Ranch Hand
Posts: 961
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The java.io.File class has a method exists().
 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Try this


exists....checks whether the input exists (it can be a file or a folder)
isDirectory..checks whether the input exists and if it exists....it should be a directory...
[ October 04, 2006: Message edited by: A Kumar ]
 
Madhu Sudhana
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got the answer

its simple


[ October 04, 2006: Message edited by: sudhana madhu ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic