> I'm using the WebdavResource object in my client code. I create a
> Webdav resource like so:
>
> WebdavResource wdr = new WebdavResource(url, 1);
>
> and it does a propfind on my slide servlet. So this is good... Then I
> list the resources like so:
>
> WebdavResource[] wdrs = wdr.listWebdavResources();
>
> But, this generates ANOTHER propfind, which I think should be totally
> unnecessary. My question is, am I wrong in think it is unnecessary? And
> if not, what should WebdavResource actually do? Should it NOT issue a
> propfind when the object is created? This might be nice if you create
> the object to do other things, such as a get/put method, and you don't
> need a propfind. Or should the listWebdavResources() method check and
> see if it already has the properties in memory? I suppose you could
> argue that these properties are out of date though...
>
> Thanks for your help!
I would use the new WebdavResource(url) constructor instead. It will do a
PROPFIND with a zero depth on the url specified (to check if it exists and
if the server is WebDAV compliant), which is a lot better than doing a
PROPFIND with depth 1. Then when you call listResources() it will do a
PROPFIND with depth 1.
Overall, I wouldn't want to cache the result of a PROPFIND.
WebFolders have a similar behavior : it does a few "useless" requests when
you connect, and doesn't cache PROPFIND.
Remy