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 ms...@apache.org on 2002/08/28 09:04:21 UTC
cvs commit: jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods LockMethod.java
msmith 2002/08/28 00:04:20
Modified: src/webdav/client/src/org/apache/webdav/lib
WebdavResource.java
src/webdav/client/src/org/apache/webdav/lib/methods
LockMethod.java
Log:
Client changes to allow retrieval of the <owner> element returned by the
server on a lock request. This sometimes differs from that sent by the
client (at least with slide, it seems)
Revision Changes Path
1.45 +13 -1 jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/WebdavResource.java
Index: WebdavResource.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/WebdavResource.java,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- WebdavResource.java 16 Aug 2002 02:53:54 -0000 1.44
+++ WebdavResource.java 28 Aug 2002 07:04:20 -0000 1.45
@@ -591,6 +591,11 @@
*/
protected String getEtag = "";
+ /**
+ * Owner information for locking and unlocking.
+ */
+ protected String owner = null;
+
/**
* An WebDAV property, ishidden.
@@ -1407,6 +1412,12 @@
this.getEtag = getEtag;
}
+ /**
+ * Get the owner string, as used for locking purposes.
+ */
+ public String getOwner() {
+ return owner;
+ }
/**
* Get the value of DAV property, supportedlock.
@@ -1463,7 +1474,7 @@
}
return buff.elements();
}
-
+
/**
* Test that this resource is locked.
@@ -3579,6 +3590,7 @@
if (state != null) {
state.addLock(path, lock);
}
+ this.owner = method.getOwner();
// Possbile LOCK Status Codes => SC_OK
// WebdavStatus.SC_SC_PRECONDITION_FAILED, SC_LOCKED
1.32 +17 -3 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.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- LockMethod.java 14 Aug 2002 15:22:24 -0000 1.31
+++ LockMethod.java 28 Aug 2002 07:04:20 -0000 1.32
@@ -367,6 +367,11 @@
this.owner = owner;
}
+ /** Return the owner of the lock as reported by the server. */
+ public String getOwner() {
+ return owner;
+ }
+
public void setScope(short scope) {
checkNotUsed();
@@ -559,6 +564,15 @@
((WebdavState) this.state).addLock
(getPath(), this.lockToken);
}
+ }
+
+ list = getResponseDocument().getDocumentElement()
+ .getElementsByTagName(prefix + "owner");
+
+ if (list.getLength() == 1) {
+ Element owner = (Element)list.item(0);
+
+ this.owner = DOMUtils.getTextValue(owner);
}
}
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>