jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Jackrabbit Wiki] Update of "WebDAV" by WillScheidegger
Date Wed, 14 Jan 2009 14:08:19 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Jackrabbit Wiki" for change notification.

The following page has been changed by WillScheidegger:
http://wiki.apache.org/jackrabbit/WebDAV

------------------------------------------------------------------------------
      }
      
    }}}
+   * Getting a list of subresources of a resourece
+   {{{
+     String host = "http://www.somehost.com";
+     String resourcePath = "/duff";
+     DavMethod pFind = new PropFindMethod(host + resourcePath, DavConstants.PROPFIND_ALL_PROP,
DavConstants.DEPTH_1);
+     client.executeMethod(pFind);
+ 
+     MultiStatus multiStatus = pFind.getResponseBodyAsMultiStatus();
+     MultiStatusResponse[] responses = multiStatus.getResponses();
+     MultiStatusResponse currResponse;
+     ArrayList files = new ArrayList();
+     System.out.println("Folders and files in " + resourcePath + ":");
+     for (int i=0; i<responses.length; i++) {
+         currResponse = responses[i];
+         if (!(currResponse.getHref().equals(path) || currResponse.getHref().equals(path
+ "/"))) {
+             System.out.println(currResponse.getHref());
+         }
+     }  
-   * Setting a property of a resource
+   }}}  * Setting a property of a resource
    {{{
          DavPropertySet newProps=new DavPropertySet();	
  	DavPropertyNameSet removeProperties=new DavPropertyNameSet();

Mime
View raw message