dirkv 01/07/30 13:00:38
Modified: src/webdav/client/src/org/apache/webdav/lib/properties
LockDiscoveryProperty.java
Log:
in the header it is "infinity" but in the body it is "Infinity"
-> ignore case
Revision Changes Path
1.9 +16 -10
jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/properties/LockDiscoveryProperty.java
Index: LockDiscoveryProperty.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/properties/LockDiscoveryProperty.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- LockDiscoveryProperty.java 2001/06/20 01:14:27 1.8
+++ LockDiscoveryProperty.java 2001/07/30 20:00:38 1.9
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/properties/LockDiscoveryProperty.java,v
1.8 2001/06/20 01:14:27 remm Exp $
- * $Revision: 1.8 $
- * $Date: 2001/06/20 01:14:27 $
+ * $Header:
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/properties/LockDiscoveryProperty.java,v
1.9 2001/07/30 20:00:38 dirkv Exp $
+ * $Revision: 1.9 $
+ * $Date: 2001/07/30 20:00:38 $
*
* ====================================================================
*
@@ -88,7 +88,8 @@
* @author Jojada J. Tirtowidjojo at SpeedLegal Holdings Inc.
* @author <a href="mailto:[EMAIL PROTECTED]">Park, Sung-Gu</a>
* @author Remy Maucherat
- * @version $Revision: 1.8 $
+ * @author Dirk Verbeeck
+ * @version $Revision: 1.9 $
*/
public class LockDiscoveryProperty extends BaseProperty {
@@ -139,11 +140,7 @@
} catch (ClassCastException e) {
}
}
- Lock[] tempLocks = new Lock[locks.size()];
- for (int i=0; i<locks.size(); i++) {
- tempLocks[i] = (Lock) locks.get(i);
- }
- return tempLocks;
+ return (Lock[]) locks.toArray(new Lock[locks.size()]);
}
@@ -188,8 +185,17 @@
d = DepthSupport.DEPTH_0;
} else if ("1".equals(depth)) {
d = DepthSupport.DEPTH_1;
- } else if ("infinity".equals(depth)) {
+ } else if ("infinity".equalsIgnoreCase(depth)) {
d = DepthSupport.DEPTH_INFINITY;
+ } else {
+ try {
+ d = Integer.parseInt(depth);
+ if (d<0) {
+ d = -1; // unknown
+ }
+ } catch (NumberFormatException ex) {
+ d = -1; // unknown
+ }
}
}
}