[opencms-dev] Existing file

Emiliano Viera eviera at sdd.com.ar
Mon Jan 26 20:51:01 CET 2004


I've just found the way in an old post:

  boolean result = false;
   try {
    cmsObject.readFileHeader(resource);
    result = true;
   } catch (CmsException e) {
    result = false;
   }

Thanks anyway

  ----- Original Message ----- 
  From: Emiliano Viera 
  To: opencms-dev 
  Sent: Monday, January 26, 2004 4:41 PM
  Subject: [opencms-dev] Existing file


  How can i check that a file in the VFS exists ?

  Im trying to show images instead of text on a menu, but i need to ensure that the image file do exists. If i try to do something like:

  cms.link("/system/galleries/pics/App/" + nav.getNavText() + ".gif")

  It always returns a string and doesn't check that the referenced file exists. If i use it, and the file doens't exists, the browser shows a broken image.

  Thanks
  Emiliano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20040126/c393cd41/attachment.htm>


More information about the opencms-dev mailing list