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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply 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: 973


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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: find whether the folder exists or not
 
Similar Threads
creating a tree in JSP
Create folder
weblogic
Package does not exist
diference between mkdirs and mkdirs?