Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Testing if folder is there

 
Steve Van
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic