File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes find whether the folder exists or not Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "find whether the folder exists or not" Watch "find whether the folder exists or not" New topic
Author

find whether the folder exists or not

Madhu Sudhana
Ranch Hand

Joined: Apr 16, 2006
Posts: 127
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??


"And the trouble is, if you don't risk anything, you risk even more." -- Erica Jong.
Edwin Dalorzo
Ranch Hand

Joined: Dec 31, 2004
Posts: 961
The java.io.File class has a method exists().
A Kumar
Ranch Hand

Joined: Jul 04, 2004
Posts: 979


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

Joined: Apr 16, 2006
Posts: 127
I got the answer

its simple


[ October 04, 2006: Message edited by: sudhana madhu ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: find whether the folder exists or not