• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Testing if folder is there

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
?
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic