It is a good approach, thank a lot.
 
regards
Yong
----- Original Message ----- From: "Ingo Brunberg" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 24, 2004 7:41 PM
Subject: Re: question about WebdavResource.exists()



> I would recommend not to use exists() at all. Whenever I want to check
> the existence of a resource I simply use the HEAD method.
> 
> For the given example:
> 
> if (webdavResource.headMethod("/rootpath/files/test.txt") {
>    // test.txt exists
> }
> 
> Regards,
> Ingo
> 
> > All,
> >  
> > Does anyone know how to use exists() method in 
> > org.apache.webdav.lib.WebdavResource?
> >  
> >  
> > In WebdavResource.java's comments, I find that exists() is similar to the exists() 
> > in java.io.File, so I think if i want to check if one file(such as files/test.txt) 
> > exists, i can do as following:
> >  
> >   1. create a instance of WebdavResource;
> >   2. call setPath(/rootpath/files/test.txt); (rootPath is the slide's root path)
> >   3. call exists() to check if the files exists.
> >  
> > but if the file doesn't exists, HttpException will be thrown when calling 
> > setPath(), so I have no change to call exists(). 
> >  
> > Is my usage of exists() right? If not, how should i use it?
> >  
> > Thanks in advance.
> >  
> > regards
> > Yong
> 
> 



---------------------------------
Do You Yahoo!?
嫌邮箱太小?雅虎电邮自助扩容!

Reply via email to