aspose file tools*
The moose likes Beginning Java and the fly likes Testing if folder is there Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Testing if folder is there" Watch "Testing if folder is there" New topic
Author

Testing if folder is there

Steve Van
Greenhorn

Joined: Nov 07, 2005
Posts: 1
Hi all,

I am trying to write a little java script and i want to see if i can test if a folder exists or not. I looked it up (yea google!) and found this reference

public static boolean exists(Folder folder)

Tests to see if a folder exists in system with simple test that folderID > 0. Use only on folder objects created using FolderController.get() methods. If you manually set the folderID, this test will not be accurate return true if successful

Does that mean that all i have to do to call it is something like this?
exists(foldervariable)
?
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Originally posted by Steve Van:
...i want to see if i can test if a folder exists or not. I looked it up (yea google!) and found this reference, public static boolean exists(Folder folder)...

Welcome to JavaRanch!

What you found appears to be from the package edu.stanford.coursework.coursematerial.

So if you're doing coursework at Stanford, then maybe that's what you want. Otherwise, you might have better luck with something from the standard Java 1.5.0 API. In particular, java.io.File. Note that the File class has methods exists() and isDirectory().
Originally posted by Steve Van:
...I am trying to write a little java script...

On the other hand, if "script" is really what you're doing, then you'll have better luck in the "HTML and JavaScript" forum. (Java is not JavaScript.)
[ November 07, 2005: Message edited by: marc weber ]

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Testing if folder is there
 
Similar Threads
look and feel problem
bean:write tag inside logic:equal wont work :(
delete a folder using httpunit
Building a query for Tree
Question about constructor?