Skip to content

Java + WebDAV … a solution for the PITA

Spent the day tooling about with Java web DAV libraries and the Apache httpd server on a Centos machine. First, just let me start by saying that if your webDAV installation on Apache ain’t working as it should and you’re on a Redhat-style installation, have a good look at what SELinux is doing. If I’d looked sooner it would have saved me a couple of hours!

But the bigger headache was the Java libraries for handling WebDAV. There is the now-abandoned Apache Slide, the based-on-Slide webdavclient4j, and the way-more-complex-than-it-needs-to-be Jackrabbit. Slide and webdavclient4J have the appearance and feel of crusty, molten code from 2004. Jackrabbit is a full-featured server product … to quote, it is a “hierarchical content store with support for structured and unstructured content, full text search, versioning, transactions, observation” … and I’m sure that’s real nice if that’s what you want, but I just need to automate push a file onto an Apache HTTPD instance and tell another service what URL it now lives at. It’s not rocket science. Jackrabbit has too many features, and too little simple documentation, to be truly useful for what I need.

Enter the easy to use WebDAV client, Sardine. Here is the author’s post announcing it.  It’s very simple to use:

Sardine sardine = SardineFactory.begin();
List<DavResource> resources = sardine.getResources("http://yourdavserver.com/adirectory/");
for (DavResource res : resources)
{
     System.out.println(res);
}

Anyway, simplicity … just the sort of thing I was looking for. Recommended.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • DZone
  • StumbleUpon
  • Technorati
  • TwitThis
  • LinkedIn

One Trackback/Pingback

  1. [...] This post was mentioned on Twitter by scot mcphee. scot mcphee said: Java + WebDAV … a solution for the PITA http://ff.im/-jceN5 [...]