Common Java Cookbook

Edition: 0.19

Download PDF or Read on Scribd

Download Examples (ZIP)

11.16. Obtaining Jakarta Slide

Warning

Slide has died. While this section remains in the book, you should know that it will soon be replaced with a section devoted to Apache Jackrabbit: the successor to Jakarta Slide.

11.16.1. Problem

You need to use Jakarta Slide to access a Web-based Distributed Authoring and Versioning ( WebDAV) resource.

11.16.2. Solution

To use Jakarta Slide 2.1 in a Maven 2 project, add the following dependency to your project's pom.xml:

Example 11.3. Adding a Dependency on Slide

    <dependency>
        <groupId>slide</groupId>
        <artifactId>slide-webdavlib</artifactId>
        <version>2.1</version>
    </dependency>  

If you are not sure what this means, I'd suggest reading Maven: The Definitive Guide. When you depend on a library in Maven 2, all you need to do is add the dependency groupId, artifactId, and version to your project's dependencies. Once you do this, Maven 2 will download the dependency and make it available on your project's classpath.

11.16.3. Discussion

WebDAV, defined in RFC 2518, is an extension of HTTP/1.1, which supports distributed and collaborative authoring of content. Using a WebDAV client you can read, modify, copy, move, lock, and unlock resources, and you can read, enumerate, and modify properties associated with resources and collections of resources. Resources made available with WebDAV can be mounted as filesystems in Windows XP/2000, Mac OS X, and Linux, and the DAV protocol can be thought of as defining a filesystem built on top of HTTP/1.1. The WebDAV protocol is at the core of a number of distributed version control and content management systems.

Jakarta Slide extends Jakarta HttpClient implementing HttpMethod for the methods introduced by the WebDAV protocol. For example, the LockMethod in the org.apache.webdav.lib.methods package is an instance of HttpMethod from Jakarta HttpClient, and just as WebDAV is an extension of HTTP/1.1, Jakarta Slide is an extension of Jakarta HttpClient. When dealing with authentication, cookie management, or redirects, you can configure Jakarta Slide the same way you would configure Jakarta HttpClient; to use Slide, you must create an instance of HttpClient.

11.16.4. See Also

For more information about the Jakarta Slide project... don't even bother. The slide project expired years ago. Please don't learn more about Slide just wait until this book is updated with content about Apache Jackrabbit. Sorry.

It is far beyond the scope of this book to fully describe WebDAV, and attempting to do so in one or two recipes would not do it justice. WebDAV, like the protocol it extends, has the potential to transform the way people think about content creation, file sharing, and version control. To learn more about WebDAV, see the following resources:

If you would like to set up your own WebDAV resource, I recommend installing the Apache HTTP Server with mod_dav. More information about installing "The Number One HTTP Server on the Internet" can be found at http://httpd.apache.org/. Information about configuring mod_dav can be found at http://httpd.apache.org/docs-2.0/mod/mod_dav.html. The Jakarta Tomcat 5.0 distribution is bundled with a web application that exposes a resource using a WebDAV servlet. To download and install Jakarta Tomcat 5.0, see http://jakarta.apache.org/tomcat/.


Creative Commons License
Common Java Cookbook by Tim O'Brien is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 United States License.
Permissions beyond the scope of this license may be available at http://www.discursive.com/books/cjcook/reference/jakartackbk-PREFACE-1.html. Copyright 2009. Common Java Cookbook Chunked HTML Output. Some Rights Reserved.