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 re...@apache.org on 2001/02/07 06:59:09 UTC
cvs commit: jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods LockMethod.java
remm 01/02/06 21:59:09
Modified: src/webdav/client/src/org/apache/webdav/lib/methods
LockMethod.java
Log:
- Should implement lock refresh.
- A new constructor has been added
LockMethod(String path, String refreshOpaqueToken, long timeout).
- Also added a checkUsed() on the getLockToken method (since its will
have a non null value only after executing (successfully) the method.
- Removed the duplicate state member variable.
Revision Changes Path
1.12 +16 -10 jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/LockMethod.java
Index: LockMethod.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/LockMethod.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- LockMethod.java 2001/02/05 18:20:09 1.11
+++ LockMethod.java 2001/02/07 05:59:09 1.12
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/LockMethod.java,v 1.11 2001/02/05 18:20:09 remm Exp $
- * $Revision: 1.11 $
- * $Date: 2001/02/05 18:20:09 $
+ * $Header: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/LockMethod.java,v 1.12 2001/02/07 05:59:09 remm Exp $
+ * $Revision: 1.12 $
+ * $Date: 2001/02/07 05:59:09 $
*
* ====================================================================
*
@@ -198,9 +198,6 @@
private String owner = null;
- private State state = null;
-
-
/**
* Lock token.
*/
@@ -230,6 +227,16 @@
/**
* Method constructor.
*/
+ public LockMethod(String path, String refreshOpaqueToken, long timeout) {
+ this(path);
+ this.refreshOpaqueToken = refreshOpaqueToken;
+ setTimeout(timeout);
+ }
+
+
+ /**
+ * Method constructor.
+ */
public LockMethod(String path, String owner, short scope, long timeout) {
this(path);
setOwner(owner);
@@ -267,6 +274,7 @@
public String getLockToken() {
+ checkUsed();
return this.lockToken;
}
@@ -336,7 +344,6 @@
this.type = TYPE_WRITE;
this.scope = SCOPE_EXCLUSIVE;
this.timeout = TIMEOUT_INFINITY;
- this.state = null;
}
@@ -372,7 +379,6 @@
setHeader("Content-Type", "text/xml; charset=utf-8");
- this.state = state;
}
@@ -469,8 +475,8 @@
NodeList list2 = locktoken.getElementsByTagName(
prefix + "href");
if (list2.getLength() == 1) {
- lockToken = DOMUtils.getTextValue(list2.item(0));
- this.state.addLock(getPath(), lockToken);
+ this.lockToken = DOMUtils.getTextValue(list2.item(0));
+ this.state.addLock(getPath(), this.lockToken);
}
}
}