Creating a WebDAV Resource

Creating a WebdavResource is simple. All you need to do is create an org.apache.commons.httpclient.HttpURL to your Slide repository and set the username/password. Pass this URL to the WebdavResource constructor, and you have a ready WebdavResource that you can use to perform various WebDAV tasks.

Example code:

        WebdavResource res=null;
        try {
            HttpURL homeUrl = new HttpURL("http://localhost:8080/slide/files");
            homeUrl.setUserinfo("root","root");
            res = new WebdavResource(homeUrl);
            if(res==null) {
                //Something is wrong!!!
            }
        }
        catch(HttpException he) {
            System.out.println(he);
        }
        catch(IOException ioe) {
            System.out.println(ioe);
        }

-LuanneCoutinho

CreateWebDavResource (last edited 2009-09-20 22:02:33 by localhost)