You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by Apache Wiki <wi...@apache.org> on 2009/01/14 15:08:19 UTC
[Jackrabbit Wiki] Update of "WebDAV" by WillScheidegger
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();