Monday, January 4, 2010

sardine - a very partial webdav client for java

For ages now, I've had the need for a webdav client for java that just implemented the features that I needed and wasn't an overcomplicated undocumented mess (cough jackrabbit cough).

Primarily, I just needed the ability to get directory listings, put files on the server and get an InputStream to a remote file. I also wanted it to use a recent version of Apache HttpComponents.

Since nothing like this exists, I created one... it is called Sardine. Hopefully someone else will find this smelly fish useful. Enjoy.


Claus Ibsen said...

Jon, Sardine looks really promising.

At Apache Camel we are looking for a nice and simple WebDAV client to integrate with.

If you are interested to help or provide some hints if Sardine is up for the task then you can get back in touch with us.

We have a ticket in JIRA to track this at:

Unknown said...

Jon, thanks for putting this up. I totally agree about the need for a simple WebDav client, though I like JackRabbit as a server :)

Unknown said...

Yes, my apologies, it wasn't a dig against JR as a project... I actually have never used it... but the claims that they have a webdav client are pretty thin given the complete lack of documentation and how hard it is to use.

dickd said...


Can your client also be used to put a file on Microsoft Sharepoint server?


Unknown said...

I don't know. But if it supports HTTP PUT, then it should!

dickd said...

Next week I will give it a try.
I 'll let you know.


constance eustace said...

I just used it for a minimal read-only WebDAV client.

Feature request:

WebDAV includes versioning protocols, doesn't it, so in theory using WebDAV people could retrieve v1.0, v2.0 of a file (don't know how this works in the specs).

Don't know if any WebDAV servers bothered to implement that though.

Anyway, thanks for the lib.

Unknown said...

versioning with webdav is implemented with projects like subversion. for that, you can just use the libraries.

Unknown said...

That's very good .. saved me a pain from Jackrabbit / webdav4J. Do you want by any chance a Mavenized version of the project? I had to check the code code out and Mavenise it in order to use it.

Unknown said...

Maybe you missed the 'Featured Wiki Page' titled 'Maven'?

Unknown said...

yes, yes i did miss that. but still the project itself isn't mavenised! ;-)

Unknown said...

The project itself (and any project I ever do) will never be mavenised as Maven is a pile of dog crap. Sorry.

Unknown said...

Hi Jon,

you achieved you goal. It's really straight forward to do some WebDAV Synchronisation. Thanks and keep up the good work.


Mano said...

Hi Jon,

I am using your WebDAV client library in a Java application to upload some files to an Alfresco instance.

The problem is that I am doing this in a loop and it seems to always hang on the third file? Maybe this is an Alfresco problem but just thought I'd share this with you.

Nevertheless, nice work!

Unknown said...

Thanks. The latest version (146) shouldn't have this problem.

Unknown said...

I've been playing with Sardine for some time now. It works really well and I completely agree with your attitude towards keeping things simple. Thanks for the great work.

Jack said...

Hi,Jon,I want to know if sardine support uploading very big files(may be 10GB)?And sardine support resume uploading?