dirkv 01/07/13 05:37:22
Modified: src/webdav/client/src/org/apache/webdav/cmd Slide.java
Log:
support for PrincipalCollectionSetProperty
Revision Changes Path
1.31 +41 -6
jakarta-slide/src/webdav/client/src/org/apache/webdav/cmd/Slide.java
Index: Slide.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/cmd/Slide.java,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- Slide.java 2001/07/11 21:21:05 1.30
+++ Slide.java 2001/07/13 12:37:14 1.31
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/cmd/Slide.java,v 1.30
2001/07/11 21:21:05 dirkv Exp $
- * $Revision: 1.30 $
- * $Date: 2001/07/11 21:21:05 $
+ * $Header:
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/cmd/Slide.java,v 1.31
2001/07/13 12:37:14 dirkv Exp $
+ * $Revision: 1.31 $
+ * $Date: 2001/07/13 12:37:14 $
*
* ====================================================================
*
@@ -87,6 +87,7 @@
import org.apache.webdav.lib.WebdavResource;
import org.apache.webdav.lib.methods.*;
import org.apache.webdav.lib.properties.AclProperty;
+import org.apache.webdav.lib.properties.PrincipalCollectionSetProperty;
import org.apache.webdav.lib.Ace;
import org.apache.webdav.lib.Privilege;
@@ -993,12 +994,44 @@
System.out.println();
showAces(path, acl.getAces());
} else
- if (todo.equalsIgnoreCase("propget") ||
+ if (todo.equalsIgnoreCase("principalcol") ||
+ todo.equalsIgnoreCase("principalcoll") ||
+ todo.equalsIgnoreCase("principalcollection") ||
+ todo.equalsIgnoreCase("principalcollectionset") ||
+ todo.equalsIgnoreCase("principal-collection-set"))
{
+ String path=null;
+ PrincipalCollectionSetProperty set=null;
+ int count = params.size();
+ if (count>1) {
+ System.out.println("principalcol has a maximum of 1
argument");
+ continue;
+ }
+ if (count==1) {
+ path=checkUri((String)params.pop());
+ }
+ else {
+ path=webdavResource.getPath();
+ }
+ set = webdavResource.principalCollectionSetFindMethod(path);
+
+ if (set==null)
+ {
+ System.out.println("Error: PropFind didn't return an
PrincipalCollectionSetProperty!");
+ continue;
+ }
+ System.out.println();
+ System.out.println("PrincipalCollectionSet for
" + path + ":");
+ String[] hrefs=set.getHrefs();
+ for (int i=0 ; i<hrefs.length ; i++)
+ System.out.println(" " + hrefs[i]);
+ System.out.println();
+ } else
+ if (todo.equalsIgnoreCase("propget") ||
todo.equalsIgnoreCase("propfind")) {
// FIXME: some work is still needed.
int count = params.size();
if (count <= 1) {
- System.out.print("Propget/propfind requires at least 2
arguments");
+ System.out.println("Propget/propfind requires at least 2
arguments");
continue;
}
@@ -1550,8 +1583,10 @@
"Set URL encoding flag, default: on");
System.out.println(" set debug {on|off|<level>} " +
"Set debug level, default: off");
- System.out.println(" acl [path] " +
+ System.out.println(" acl [<path>] " +
"Displays the ACL of path");
+ System.out.println(" principalcol [<path>] " +
+ "Displays the principal collection set of path");
System.out.println(" grant [<namespace>] <permission> [on <path>] to
<principal>");
System.out.println(" deny [<namespace>] <permission> [on <path>] to
<principal>");
System.out.println(" revoke [<namespace>] <permission> [on <path>] from
<principal>");