You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by di...@apache.org on 2001/08/08 23:57:10 UTC
cvs commit: jakarta-slide/src/webdav/client/src/org/apache/webdav/cmd Slide.java
dirkv 01/08/08 14:57:10
Modified: src/webdav/client/src/org/apache/webdav/cmd Slide.java
Log:
support for the new logging components from httpclient
Revision Changes Path
1.36 +15 -26 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.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- Slide.java 2001/07/30 20:11:43 1.35
+++ Slide.java 2001/08/08 21:57:09 1.36
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/cmd/Slide.java,v 1.35 2001/07/30 20:11:43 dirkv Exp $
- * $Revision: 1.35 $
- * $Date: 2001/07/30 20:11:43 $
+ * $Header: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/cmd/Slide.java,v 1.36 2001/08/08 21:57:09 dirkv Exp $
+ * $Revision: 1.36 $
+ * $Date: 2001/08/08 21:57:09 $
*
* ====================================================================
*
@@ -81,6 +81,7 @@
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.HttpException;
+import org.apache.commons.httpclient.log.Log;
import org.apache.util.HttpURL;
@@ -93,6 +94,7 @@
import org.apache.webdav.lib.Ace;
import org.apache.webdav.lib.Privilege;
import org.apache.webdav.lib.Lock;
+import org.apache.webdav.lib.PropertyName;
/**
* The Slide client, the command line version for WebDAV client.
@@ -104,7 +106,6 @@
*/
public class Slide {
-
/**
* The version information for the Slide client.
*/
@@ -144,7 +145,7 @@
/**
* The debug level.
*/
- private int debugLevel = 0;
+ private int debugLevel = Log.WARN;
/**
@@ -1043,7 +1044,7 @@
Vector properties = new Vector();
for (int i = 0; i < count-1; i++) {
- String property = (String) params.pop();
+ PropertyName property = new PropertyName("DAV:", (String) params.pop());
properties.addElement(property);
}
String path = checkUri((String) params.pop());
@@ -1367,28 +1368,16 @@
("URL encoding flag is off.");
}
} else if (key.equalsIgnoreCase("debug")) {
- if ((value.equalsIgnoreCase("on")) ||
- (value.equalsIgnoreCase("all"))) {
- debugLevel = Integer.MAX_VALUE;
+ if (value.equalsIgnoreCase("on")) {
+ debugLevel = Log.DEBUG;
webdavResource.setDebug(debugLevel);
- System.out.println
- ("The debug flag is on (level=all).");
- } else if (value.equalsIgnoreCase("off") ||
- (value.equalsIgnoreCase("0"))) {
- webdavResource.setDebug(debugLevel = 0);
+ System.out.println("The debug flag is on.");
+ } else if (value.equalsIgnoreCase("off")) {
+ debugLevel = Log.WARN;
+ webdavResource.setDebug(debugLevel);
System.out.println("The debug flag is off.");
} else {
- try {
- debugLevel = Integer.parseInt(value);
- webdavResource.setDebug(debugLevel);
- System.out.println
- ("The debug flag is on (level=" +
- debugLevel + ").");
- } catch (NumberFormatException nfe) {
- System.err.println
- ("Invalid value, valid vlaues " +
- "are 'on', 'off', <level>");
- }
+ System.err.println("Invalid value, valid values are 'on', 'off'");
}
} else {
System.err.println("Invalid option.");
@@ -1636,7 +1625,7 @@
"Set property with given value");
System.out.println(" set URLencode {on|off} " +
"Set URL encoding flag, default: on");
- System.out.println(" set debug {on|off|<level>} " +
+ System.out.println(" set debug {on|off} " +
"Set debug level, default: off");
System.out.println(" acl [<path>] " +
"Displays the ACL of path");