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.

17 comments:

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: https://issues.apache.org/activemq/browse/CAMEL-2331

Joe Rosenblum 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 :)

Jon Scott Stevens 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...

Jon,

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

DD

Jon Scott Stevens 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.

Thanks
DD

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.

Jon Scott Stevens said...

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

victor xray 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.

Jon Scott Stevens said...

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

victor xray said...

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

Jon Scott Stevens said...

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

Holger said...

Hi Jon,

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

Best
Holger

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!

Jon Scott Stevens said...

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

Remco 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 Leung said...

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