Garret, After you construct your WebdavResource you should be able to call headMethod() to see if the remote resource exists. I don't know if this is the best method, but it should work.
-James On Sun, 2004-12-12 at 17:13 -0800, Garret Wilson wrote: > I started using Slide just days ago, and immediately ran into the > WebdavResource weirdness for non-existent files: constructing a > WebdavResource for a file that doesn't exist throws an HttpException > with status code 404. > > After searching the archives, I found a workaround of new > WebdavResouce(httpURL, WebdavResource.NOACTION, 0), which disables PROPFIND: > > http://nagoya.apache.org/eyebrowse/[EMAIL PROTECTED]&msgId=2039251 > > Now I can use putMethod() to upload a file whether or not the file > already exists. But how do I check to see that it already exists? After > using the above constructor, WebdavResource.exists() always returns > false---even if I've just uploaded a file to the same URL! Apparently > disabling PROPFIND keeps WebdavResource from knowing anything about the > file on the server. > > So how can I see if a file exists? I'm guessing the following would work: > > WebdavResource webdavresource; > try > { > webdavresource=new WebdavResource(httpURL); > webdavresource.setExistence(true); > } > catch(HttpException e) > { > if(e.getReasonCode()==404) > { > webdavresource=new WebdavResource(httpURL, WebdavResource.NOACTION, 0); > webresource.setExistence(false); > } > else > { > throw e; > } > } > > If this is the way things are supposed to be done, I'll have to say this > isn't the best example of API elegance I've seen. :| I'm hoping I'm > missing something. > > How should I be using WebdavResource? > > Thanks, > > Garret > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]