This is of course the most obvious and elegant solution for this scenario. Still the question remains: Should an exception be thrown in case of a 404 response to a PROPFIND request?
Ingo > Hi Robert, > > you have to use another constructor: > WebdavResource r = new WebdavResource(url,WebdavResource.NOACTION,0); > > So no propfind is executed before you do the put request. > > HTH > Martin > > > > > -----Original Message----- > > From: Robert Bjornson [mailto:[EMAIL PROTECTED] > > Sent: Donnerstag, 11. Dezember 2003 17:02 > > To: [EMAIL PROTECTED] > > Subject: Question about non-existent files. > > > > > > I've been using the client library for Slide 1.0.16 for > > several months. > > I've decided to attempt to move to the top of the development tree in > > order to pick up a bunch of bug fixes, and am having a > > problem creating > > a reference to a non-existent file. > > > > In the past, in order to create a new file, I did: > > > > WebdavResource r = new WebdavResource(url) // where the url > > refers to a > > non existent file in an existing and writable directory > > > > r.putMethod("this is my data") > > > > This worked fine in 1.0.16, but using the top of the tree, I get an > > exception which I'm including at the bottom of the email. > > The exception > > occurs when I construct the WebdavResource. > > (note that I'm actually invoking this from within jython). > > > > My Dav Server is a 2.0.45 Apache with dav support compiled in. > > It's worked just fine with the 1.0.16. release. > > > > Looking through the source, there is a change to the propfindMethod > > in WebdavResource.java (revision 1.54). It's now looking for a > > multistatus reply from the > > server and throwing an exception if the reply wasn't a multistatus. > > Using tcpmon, I can see that the response is, in fact, just a > > 404 not found. But the old code was ok with this. > > > > I'm a more than a little perplexed, since I imagine that I can't > > be the only one who would run into this. > > > > If anyone shed any light on this, I'd be very grateful. > > > > Rob Bjornson > > > > > > > > ============== > > Listen Port: 6999 > > Target Host: 127.0.0.1 > > Target Port: 24162 > > ==== Request ==== > > PROPFIND /datarepository/test/newfile HTTP/1.1 > > Content-Length: 207 > > Content-Type: text/xml; charset=utf-8 > > Host: 127.0.0.1 > > Depth: 0 > > User-Agent: Jakarta HTTP Client/1.0 > > > > <?xml version="1.0" encoding="utf-8" ?><D:propfind > > xmlns:D="DAV:"><D:prop><D:displayname/><D:getcontentlength/><D > > :getcontenttype/><D:resourcetype/><D:getlastmodified/><D:lockd > > iscovery/></D:prop></D:propfind>==== > > Response ==== > > HTTP/1.1 404 Not Found > > Date: Thu, 11 Dec 2003 15:05:45 GMT > > Server: Apache/2.0.45 (Unix) DAV/2 > > Content-Length: 306 > > Content-Type: text/html; charset=iso-8859-1 > > > > <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> > > <html><head> > > <title>404 Not Found</title> > > </head><body> > > <h1>Not Found</h1> > > <p>The requested URL /datarepository/test/newfile was not > > found on this > > server.</p> > > <hr /> > > <address>Apache/2.0.45 (Unix) DAV/2 Server at 127.0.0.1 Port > > 80</address> > > </body></html> > > > > ============== > > > > > > org.apache.commons.httpclient.HttpException > > at > > org.apache.webdav.lib.WebdavResource.propfindMethod(WebdavReso > > urce.java:3150) > > at > > org.apache.webdav.lib.WebdavResource.propfindMethod(WebdavReso > > urce.java:3112) > > at > > org.apache.webdav.lib.WebdavResource.setNamedProp(WebdavResour > > ce.java:881) > > at > > org.apache.webdav.lib.WebdavResource.setBasicProperties(Webdav > > Resource.java:826) > > at > > org.apache.webdav.lib.WebdavResource.setProperties(WebdavResou > > rce.java:1715) > > at > > org.apache.webdav.lib.WebdavResource.setHttpURL(WebdavResource > > .java:1153) > > at > > org.apache.webdav.lib.WebdavResource.setHttpURL(WebdavResource > > .java:1172) > > at > > org.apache.webdav.lib.WebdavResource.setHttpURL(WebdavResource > > .java:1251) > > at > > org.apache.webdav.lib.WebdavResource.setHttpURL(WebdavResource > > .java:1269) > > at > > org.apache.webdav.lib.WebdavResource.<init>(WebdavResource.java:349) > > at > > sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) > > at > > sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeCo > > nstructorAccessorImpl.java:39) > > at > > sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Dele > > gatingConstructorAccessorImpl.java:27) > > at > > java.lang.reflect.Constructor.newInstance(Constructor.java:274) > > at > > org.python.core.PyReflectedConstructor.__call__(PyReflectedCon > > structor.java) > > at > > org.python.core.PyJavaInstance.__init__(PyJavaInstance.java) > > at org.python.core.PyJavaClass.__call__(PyJavaClass.java) > > at org.python.core.PyObject.__call__(PyObject.java) > > at org.python.pycode._pyx0.f$0(bug.py:3) > > at org.python.pycode._pyx0.call_function(bug.py) > > at org.python.core.PyTableCode.call(PyTableCode.java) > > at org.python.core.PyCode.call(PyCode.java) > > at org.python.core.Py.runCode(Py.java) > > at > > org.python.core.__builtin__.execfile_flags(__builtin__.java) > > at > > org.python.util.PythonInterpreter.execfile(PythonInterpreter.java) > > at org.python.util.jython.main(jython.java) > > > > org.apache.commons.httpclient.HttpException: > > org.apache.commons.httpclient.HttpException > > >>> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
