Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 4492 invoked from network); 2 Feb 2009 18:12:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Feb 2009 18:12:27 -0000 Received: (qmail 3188 invoked by uid 500); 2 Feb 2009 18:12:22 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 3122 invoked by uid 500); 2 Feb 2009 18:12:22 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 3111 invoked by uid 99); 2 Feb 2009 18:12:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Feb 2009 10:12:22 -0800 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of phidias51@gmail.com designates 209.85.162.178 as permitted sender) Received: from [209.85.162.178] (HELO el-out-1112.google.com) (209.85.162.178) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Feb 2009 18:12:13 +0000 Received: by el-out-1112.google.com with SMTP id v27so962300ele.24 for ; Mon, 02 Feb 2009 10:11:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=kXsOF/HP3QpMOerVYCsmrGvWm+nltPuKXvXYttI+FSs=; b=KmPcl7A73QbJp7S2OoGD0isTEEuhoh4/mHbQGFbd1EX/elJ7cga47jM2gp0xNF54Ci Gxrh+gerZrMGT+Zbe40107yNBlh44qtHTVReNd+hAfwQxrjszOFBz1xX1xFmzVFCVXVv Z5QpIa4R/M6Rhz+p8q5nyfaLwLKVN89S4KR1Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=kE6exr3kOjpljvLDw4ooNf4MPWDFguxwoI4sQc5RzkWh2hfBw/IZSjDFJOZT08npWq 7I+gxdsVSeAAh28t3Uhu+ZHUbiRFBXv7gc7IVk4n842nQWlIjFXFcZa0rJKeo/G+a0E3 URX8RZtxQ/ExVzHl70sPUUjVTI2gZktRik4Pk= MIME-Version: 1.0 Received: by 10.90.74.7 with SMTP id w7mr2230465aga.60.1233598311883; Mon, 02 Feb 2009 10:11:51 -0800 (PST) In-Reply-To: <9DD46FD4-2F62-4CC2-9393-B61CAF68DCC1@dslextreme.com> References: <498675C8.9020905@its.monash.edu.au> <300444D7-A12F-4BF8-B3B3-D60D8A4F0009@dslextreme.com> <9DD46FD4-2F62-4CC2-9393-B61CAF68DCC1@dslextreme.com> Date: Mon, 2 Feb 2009 10:11:51 -0800 Message-ID: <6e1d61f50902021011i72c345c4j7603585593a109d3@mail.gmail.com> Subject: Re: Cannot connect to a webDAV server From: Mark Fortner To: Commons Users List Content-Type: multipart/alternative; boundary=0016361e892a2ce2380461f37dfa X-Virus-Checked: Checked by ClamAV on apache.org --0016361e892a2ce2380461f37dfa Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit AFAIK VFS uses a mechanism similar to the SPI mechanism ( http://java.sun.com/j2se/1.4.2/docs/guide/jar/jar.html#Service%20Provider) to automatically "discover" VFS implementations in the classpath. Each VFS provider is packaged with it's own vfs-providers.xml file which contains information required to instantiate and properly configure that plugin. No other configuration should be required to get a plugin to work. The StandardFileSystemManager class that James pointed to earlier also indicates that you can turn on debugging to find out if your provider is not loading due to some unsatisfied dependency. To get an instance of a provider, you should only have to call the VFS.getManager().resolve method to load the file manager needed to resolve your file. Hope this helps, Mark On Mon, Feb 2, 2009 at 8:51 AM, Ralph Goers wrote: > I'm not sure if we are speaking past each other here. There is no > vfs-providers.xml in the core source, so none of those providers should be > automatically configured. Instead, the user has to create the file and > configure the providers they want. Correct? > > Ralph > > > On Feb 2, 2009, at 8:25 AM, James Carman wrote: > > The plugin (non-core) providers are also auto-registered that way. >> >> On Mon, Feb 2, 2009 at 11:22 AM, Ralph Goers >> wrote: >> >>> Right. that is a config file, not a provider. The user has to configure >>> the >>> providers they want. >>> >>> On Feb 2, 2009, at 7:27 AM, James Carman wrote: >>> >>> It scans the classpath for all resources named >>>> "META-INF/vfs-providers.xml": >>>> >>>> >>>> >>>> http://svn.apache.org/repos/asf/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/impl/StandardFileSystemManager.java >>>> >>>> >>>> On Mon, Feb 2, 2009 at 10:01 AM, Ralph Goers < >>>> ralph.goers@dslextreme.com> >>>> wrote: >>>> >>>>> >>>>> It's possible I'm missing something. Where does that happen? I'm not >>>>> seeing >>>>> anything call addProvider based on the class path. >>>>> >>>>> Ralph >>>>> >>>>> On Feb 2, 2009, at 4:27 AM, James Carman wrote: >>>>> >>>>> Shouldn't it auto-register, if it's on the classpath? >>>>>> >>>>>> On Mon, Feb 2, 2009 at 12:53 AM, Ralph Goers >>>>>> >>>>>> wrote: >>>>>> >>>>>>> >>>>>>> I don't see where you registered the webdav provider with the >>>>>>> manager. >>>>>>> You >>>>>>> shouldn't need to call WebdavFileSystemConfigBuilder.getInstance(). >>>>>>> instead, >>>>>>> follow one of the methods shown at >>>>>>> http://commons.apache.org/vfs/api.html to >>>>>>> add the WebdavFileProvider. >>>>>>> >>>>>>> Whether or not you get this working, please post back with your >>>>>>> results >>>>>>> along with info about the webdav server you are connecting to. I've >>>>>>> only >>>>>>> tested with Day CRX (which is really Jackrabbit as far as WebDAV is >>>>>>> concerned) so I'd like to know what your results are. >>>>>>> >>>>>>> Ralph >>>>>>> >>>>>>> >>>>>>> On Feb 1, 2009, at 8:25 PM, Manish Saroha wrote: >>>>>>> >>>>>>> Hi All, >>>>>>>> >>>>>>>> I am new to webDAV and trying to connect to a webDAV server using >>>>>>>> the >>>>>>>> commons VFS. >>>>>>>> Checked out the source code and builded the >>>>>>>> *commons-vfs-2.0-SNAPSHOT.jar >>>>>>>> *using the ant task "jar". >>>>>>>> >>>>>>>> my code to connect is as follows: >>>>>>>> >>>>>>>> static public FileObject getFileObject() throws FileSystemException >>>>>>>> { >>>>>>>> String scheme = "webdav://" ; >>>>>>>> String hostName = "sakai-vre.its.monash.edu.au" ; >>>>>>>> int port = 8080; >>>>>>>> int defaultPort = 8080; >>>>>>>> String userName = "username"; >>>>>>>> String password = "password" ; >>>>>>>> String path = "dav/a9d8c946-4bbf-4c2b-8db5-0a62c8724683/"; >>>>>>>> String uriString = scheme + userName + ":" + password + "@" + >>>>>>>> hostName + ":" + port + "/" + path; >>>>>>>> //String uriString = scheme + hostName + ":" + port + "/" + path; >>>>>>>> StaticUserAuthenticator auth = new >>>>>>>> StaticUserAuthenticator(null, userName, "password"); >>>>>>>> FileSystemOptions opts = new FileSystemOptions(); >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> DefaultFileSystemConfigBuilder.getInstance().setUserAuthenticator(opts, >>>>>>>> auth); >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> WebdavFileSystemConfigBuilder.getInstance().setProxyAuthenticator(opts, >>>>>>>> auth) ; >>>>>>>> return VFS.getManager().resolveFile(uriString, opts); >>>>>>>> } >>>>>>>> } >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> I am getting this error >>>>>>>> >>>>>>>> 15:19:27,953 INFO DefaultFileReplicator:122 - Using >>>>>>>> "D:\DOCUME~1\masaroha\LOCALS~1\Temp\vfs_cache" as temporary files >>>>>>>> store. >>>>>>>> org.apache.commons.vfs.FileSystemException: *Badly formed URI >>>>>>>> >>>>>>>> >>>>>>>> "webdav://username:password@sakai-vre.its.monash.edu.au:8080/ >>>>>>>> dav/a9d8c946-4bbf-4c2b-8db5-0a62c8724683/".* >>>>>>>> at >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> org.apache.commons.vfs.provider.url.UrlFileProvider.findFile(UrlFileProvider.java:85) >>>>>>>> at >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:662) >>>>>>>> at >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:582) >>>>>>>> at >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> au.edu.jcu.hermes.core.filesystem.WebDavConnector.getFileObject(WebDavConnector.java:107) >>>>>>>> at >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> au.edu.jcu.hermes.core.filesystem.WebDavConnector.main(WebDavConnector.java:22) >>>>>>>> *Caused by: java.net.MalformedURLException: unknown protocol: >>>>>>>> webdav* >>>>>>>> at java.net.URL.(URL.java:574) >>>>>>>> at java.net.URL.(URL.java:464) >>>>>>>> at java.net.URL.(URL.java:413) >>>>>>>> at >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> org.apache.commons.vfs.provider.url.UrlFileProvider.findFile(UrlFileProvider.java:66) >>>>>>>> ... 4 more >>>>>>>> >>>>>>>> Any help or guideline would be appreciated. >>>>>>>> >>>>>>>> Regards, >>>>>>>> Manish >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> --------------------------------------------------------------------- >>>>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org >>>>>>> For additional commands, e-mail: user-help@commons.apache.org >>>>>>> >>>>>>> >>>>>>> >>>>>> --------------------------------------------------------------------- >>>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org >>>>>> For additional commands, e-mail: user-help@commons.apache.org >>>>>> >>>>>> >>>>> >>>>> --------------------------------------------------------------------- >>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org >>>>> For additional commands, e-mail: user-help@commons.apache.org >>>>> >>>>> >>>>> >>>> --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org >>>> For additional commands, e-mail: user-help@commons.apache.org >>>> >>>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org >>> For additional commands, e-mail: user-help@commons.apache.org >>> >>> >>> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org >> For additional commands, e-mail: user-help@commons.apache.org >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org > For additional commands, e-mail: user-help@commons.apache.org > > -- Mark Fortner blog: http://feeds.feedburner.com/jroller/ideafactory --0016361e892a2ce2380461f37dfa--