Friday, 25 March 2011

Java: Connecting to a MarkLogic WebDAV server using Apache Jackrabbit and Digest HTTP Authentication

By default, MarkLogic application servers use digest http authentication, so if you're writing some application layer code that rely on connecting to MarkLogic WebDAV, here's a simple example to get started.

The code below uses Apache Jackrabbit and HttpClient 3.x to connect to a MarkLogic WebDAV application server and logs out a list of all the files in a specific location:


I'm using maven to manage my dependencies for this. If you are too, here's the required dependencies:

No comments: