commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephan Schuster <>
Subject Re: VFS problem with StaticUserAuthenticator
Date Thu, 05 Jun 2008 15:33:13 GMT
hi yannick,

the short answer: i had the same problem about a week ago and fixed it!

the long answer: as you probably know commons-vfs uses jakarta slide for 
its webdav support. however, jakarta slide unfortunately retired at the 
of 2007. that's why jason harrop startet webdavclient4j [1] a few weeks 
ago. it is a new project that basically ports and improves the slide 
sources, for example you can use a newer version of httpclient than 
2.0.2. but most important it integrates nicely with commons-vfs and 
vfsjfilechooser. i use both in my current project.

now, why am i telling you this???

because i experienced the same problem a few weeks ago. the reason is 
that the webdav provider (of jakarta slide / webdavclient4j) does not 
respect the credentials set via StaticUserAuthenticator and 
DefaultFileSystemConfigBuilder. so i checked out the code of 
webdavclient4j and fixed it along with the implementation of an 
additional provider: webdavs (webdav over https). afterwards i posted 
the patch to the website's forum [3] and sent it per mail to jason 
harrop. so far he obviously hadn't had the time to apply the patch and 
release a new version of webdavclient4j. that's why you have to checkout 
webdavclient4j, patch it with the stuff i wrote, build it yourself and 
then use it with commons-vfs. of course you could do the same with 
jakarta slide but i wouldn't recommend that since it's a dead project. 
besides that i could send you my build of webdavclient4j but i'm not 
sure if that is what jason harrop wants. so i can't do this unless he 
tells me to do so.

hope that helps.


ps: @jason: if you want you could grant me developer rights for your 
projects. then i could do the necessary stuff myself and help yannick.


Yannick PIERSON wrote:
> Hi,
> I'm using commons VFS and  I get a problem.
> To access to virtual file system, I'm using this authentification :
> this.auth = new StaticUserAuthenticator(credentials.getDomain(),
> credentials.getUsername(), credentials.getPassword());
> This code works whith smb protocol (share windows), but doesn't work with
> webdav :
> For it I must write the url -> webdav://user:password@host:port/directory.
> And this code works...
> But I want to use the same authentification that I'm using for smb.
> Do you know why it doesn't work ?
> I think my problem is on the realm definition.
> My error trace :
> ATTENTION: No credentials available for the 'WORKGROUP' authentication realm
> at host
> Exception in thread "main" org.apache.commons.vfs.FileSystemException: Could
> not determine the type of file "webdav://host/directory/testFile.txt".
>         at
> org.apache.commons.vfs.provider.AbstractFileObject.attach(
>         at
> org.apache.commons.vfs.provider.AbstractFileObject.getType(
>         at
> org.apache.commons.vfs.provider.AbstractFileObject.exists(
>         at test.UserApp.main(
> Caused by: org.apache.commons.vfs.FileSystemException
>         at
> org.apache.commons.vfs.provider.webdav.WebdavFileObject.setDavResource(
>         at
> org.apache.commons.vfs.provider.webdav.WebdavFileObject.doAttach(
>         at
> org.apache.commons.vfs.provider.AbstractFileObject.attach(
>         ... 3 more
> Caused by: org.apache.commons.httpclient.HttpException
>         at
> org.apache.webdav.lib.WebdavResource.propfindMethod(
>         at
> org.apache.webdav.lib.WebdavResource.propfindMethod(
>         at
> org.apache.webdav.lib.WebdavResource.setNamedProp(
>         at
> org.apache.webdav.lib.WebdavResource.setDefaultProperties(
>         at
> org.apache.webdav.lib.WebdavResource.setProperties(
>         at
> org.apache.commons.vfs.provider.webdav.WebdavFileObject.setDavResource(
>         ... 5 more
> Regards,
> Thanks,

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message