[opencms-dev] Best way to determine existence of file in VFS

Ernesto De Santis ernesto.desantis at colaborativa.net
Mon Mar 15 19:15:01 CET 2004


Hi Alex

> Write one ;-)
:-).. Well...:

public boolean existFile(String filename){
   try{
        readFile(filename);
        return true;
   }catch(CmsException e){
       return false;
   }
}

But I want this method in CmsObject class.

Why CmsObject donĀ“t have this method?
(and existFolder)

Bye
Ernesto.





> Best Regards,
> Alex.
>
> Alexander Kandzior
> Alkacon Software - The OpenCms Experts
> http://www.alkacon.com
>
> > -----Original Message-----
> > From: opencms-dev-admin at opencms.org
> > [mailto:opencms-dev-admin at opencms.org] On Behalf Of Ernesto De Santis
> > Sent: Saturday, March 13, 2004 4:05 PM
> > To: opencms-dev at opencms.org
> > Subject: Re: [opencms-dev] Best way to determine existence of
> > file in VFS
> >
> >
> > > your solution is exactly right, reading the file header and
> > catching
> > > the Exception if it dosen't exist is the way to find out if a file
> > > exists or not.
> >
> > Is rigth, but is ugly. I want a method "existFile" or
> > "existResource" that return a boolean result.
> >
> > Bye
> > Ernesto.
> >
> > _______________________________________________
> > This mail is send to you from the opencms-dev mailing list
> > To change your list options, or to unsubscribe from the list,
> > please visit http://mail.opencms.org/mailman/listinfo/opencms-dev
> >
> >
>
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev
>
>




More information about the opencms-dev mailing list