Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 96539 invoked from network); 18 Apr 2008 01:42:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Apr 2008 01:42:17 -0000 Received: (qmail 63002 invoked by uid 500); 18 Apr 2008 01:42:14 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 62924 invoked by uid 500); 18 Apr 2008 01:42:14 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 62915 invoked by uid 99); 18 Apr 2008 01:42:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Apr 2008 18:42:14 -0700 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Apr 2008 01:41:22 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1Jmfbi-0007Z0-3P for user@commons.apache.org; Thu, 17 Apr 2008 18:41:42 -0700 Message-ID: <16758769.post@talk.nabble.com> Date: Thu, 17 Apr 2008 18:41:42 -0700 (PDT) From: jharrop To: user@commons.apache.org Subject: Re: [vfs] webdav, jackrabbit and fileObject.exists() In-Reply-To: <47F20E93.8070309@wilken.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: jason@plutext.org References: <47F20E93.8070309@wilken.de> X-Virus-Checked: Checked by ClamAV on apache.org Hi Stephan See http://issues.apache.org/jira/browse/VFS-207 for a patch, now 9 days old. Hopefully that fix works for jackrabbit's WebDAV. I'm considering adding the vfs webdav sandbox stuff to webdavclient4j's source tree, and maintaining it there. cheers, Jason Stephan Schuster-3 wrote: > > hi together, > > first of all thanks for this great piece of software! > > > my context: > i want to use vfs to search and - if existing - access files on my > server via webdav. as stated on the homepage i use: > commons-httpclient-2.0.2.jar > commons-logging-1.1.1.jar > commons-vfs-sandbox-1.0-SNAPSHOT.jar > jakarta-slide-webdavlib-20050629.161100.jar > jdom-1.0.jar > > my problem: > - my little test program (see below) WORKS fine IF THE FILE i want to > resolve EXISTS on the server (APACHE or JACKRABBIT deployed in tomcat). > - IF THE FILE DOES NOT EXIST > - it IS STILL WORKING on APACHE as my weddav server. > - it DOES NOT WORK on JACKRABBIT as my server. see exception below. > > the reason: > in WebdavFileObject.setDavResource(WebdavResource resource) the server > is asked via the OptionsMethod which methods it understands for the > encoded path of a potentially non existing file. i setup a proxy in > between. see the complete results at the end of my mail. > > apache returns: OPTIONS,MKCOL,PUT,LOCK > jackrabbit returns: OPTIONS, GET, HEAD, POST, TRACE, PROPFIND, > PROPPATCH, MKCOL, COPY, PUT, DELETE, MOVE, LOCK, UNLOCK, VERSION-CONTROL > > WebdavFileObject traverses each returned method and if it encounters > "COPY" it assumes that the file exists. however, this is not true for > jackrabbit. > > > now, which code is wrong? the one of jackrabbit (i looked into it but > couldn't find the right place) or the one of vfs. is there a workaround > or something else i can do? > > > thanks, > stephan > > > TEST PROGRAM: > > DefaultFileSystemManager mgr = new DefaultFileSystemManager(); > mgr.addProvider("file", new DefaultLocalFileProvider()); > mgr.addProvider("webdav", new WebdavFileProvider()); > mgr.init(); > > FileObject file = mgr.resolveFile(PATH-TO-NON-EXISTING-FILE-ON-SERVER); > > if (file.exists()) { // THAT'S WHERE THE EXCEPTION OCCURS!!! > ... > } > ... > > > EXCEPTION: > > org.apache.commons.vfs.FileSystemException: Could not determine the type > of file > "webdav://username:password@localhost:8888/jackrabbit/repository/default/test/non-existing-file.txt". > at > org.apache.commons.vfs.provider.AbstractFileObject.attach(AbstractFileObject.java:1305) > at > org.apache.commons.vfs.provider.AbstractFileObject.getType(AbstractFileObject.java:412) > at > org.apache.commons.vfs.provider.AbstractFileObject.exists(AbstractFileObject.java:402) > at test.Main2.main(Main2.java:42) > Caused by: org.apache.commons.vfs.FileSystemException > at > org.apache.commons.vfs.provider.webdav.WebdavFileObject.setDavResource(WebdavFileObject.java:190) > at > org.apache.commons.vfs.provider.webdav.WebdavFileObject.doAttach(WebdavFileObject.java:92) > at > org.apache.commons.vfs.provider.AbstractFileObject.attach(AbstractFileObject.java:1291) > ... 3 more > Caused by: org.apache.commons.httpclient.HttpException > at > org.apache.webdav.lib.WebdavResource.propfindMethod(WebdavResource.java:3517) > at > org.apache.webdav.lib.WebdavResource.propfindMethod(WebdavResource.java:3472) > at > org.apache.webdav.lib.WebdavResource.setNamedProp(WebdavResource.java:976) > at > org.apache.webdav.lib.WebdavResource.setDefaultProperties(WebdavResource.java:963) > at > org.apache.webdav.lib.WebdavResource.setProperties(WebdavResource.java:1923) > at > org.apache.commons.vfs.provider.webdav.WebdavFileObject.setDavResource(WebdavFileObject.java:186) > ... 5 more > > > PROXY OUTPUT JACKRABBIT: > > > REQUEST: > > OPTIONS /jackrabbit/repository/default/test/file3.txt HTTP/1.1 > Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ= > User-Agent: Jakarta Commons-HttpClient/2.0.2 > Host: 127.0.0.1:8000 > > PROPFIND /jackrabbit/repository/default/test/file3.txt HTTP/1.1 > Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ= > Content-Type: text/xml; charset=utf-8 > User-Agent: Jakarta Commons-HttpClient/2.0.2 > Host: localhost:8000 > Content-Length: 288 > Depth: 1 > > xmlns:D="DAV:"> > > > RESPONSE: > > HTTP/1.1 200 OK > Server: Apache-Coyote/1.1 > DAV: 1,2,version-control,version-history,label > Allow: OPTIONS, GET, HEAD, POST, TRACE, PROPFIND, PROPPATCH, MKCOL, > COPY, PUT, DELETE, MOVE, LOCK, UNLOCK, VERSION-CONTROL > MS-Author-Via: DAV > Content-Length: 0 > Date: Tue, 01 Apr 2008 10:05:39 GMT > > HTTP/1.1 404 Not Found > Server: Apache-Coyote/1.1 > Content-Type: text/html;charset=utf-8 > Content-Length: 952 > Date: Tue, 01 Apr 2008 10:05:39 GMT > > Apache Tomcat/5.5.17 - Error > report >

HTTP Status 404 -


noshade="noshade">

type Status report

message >

description The requested resource () is not > available.


Apache > Tomcat/5.5.17

> > > PROXY OUTPUT APACHE: > > > REQUEST: > > OPTIONS /webdav/test/file3.txt HTTP/1.1 > Authorization: Basic d2lsa2VuOndpbGtlbg== > User-Agent: Jakarta Commons-HttpClient/2.0.2 > Host: 127.0.0.1:8888 > > > RESPONSE: > > HTTP/1.1 200 OK > Date: Tue, 01 Apr 2008 09:49:13 GMT > Server: Apache/2.2.8 (Win32) DAV/2 mod_ssl/2.2.8 OpenSSL/0.9.8g > mod_autoindex_color PHP/5.2.5 > DAV: 1,2 > MS-Author-Via: DAV > Allow: OPTIONS,MKCOL,PUT,LOCK > Content-Length: 0 > Content-Type: text/plain > X-Pad: avoid browser bug > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org > For additional commands, e-mail: user-help@commons.apache.org > > > -- View this message in context: http://www.nabble.com/-vfs--webdav%2C-jackrabbit-and-fileObject.exists%28%29-tp16419233p16758769.html Sent from the Commons - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org