ozeigermann 2004/03/23 05:47:15
Modified: src/webdav/server/org/apache/slide/webdav/method
AbstractWebdavMethod.java LockMethod.java
Log:
Removed hack in LockMethod that made lock timeout infinite on null resources.
Instead experied locks on null resource cause the resource to be deleted
in AbstractWebdavMethod.
Revision Changes Path
1.25 +20 -3
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/AbstractWebdavMethod.java
Index: AbstractWebdavMethod.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/AbstractWebdavMethod.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- AbstractWebdavMethod.java 4 Mar 2004 09:41:50 -0000 1.24
+++ AbstractWebdavMethod.java 23 Mar 2004 13:47:15 -0000 1.25
@@ -299,6 +299,23 @@
UnlockListener listener =
new UnlockListenerImpl( slideToken, token, config, req, resp );
lock.clearExpiredLocks( slideToken, requestUri, listener );
+
+ // if the URI has no more locks associated to it and is
+ // a lock-null resource, we must attempt to delete it
+
+ Enumeration locks = lock.enumerateLocks(slideToken, requestUri);
+ if (!locks.hasMoreElements()) {
+
+ NodeRevisionDescriptors revisionDescriptors =
content.retrieve(slideToken, requestUri);
+ NodeRevisionDescriptor revisionDescriptor =
content.retrieve(slideToken, revisionDescriptors);
+ if (isLockNull(revisionDescriptor)) {
+ content.remove(slideToken, requestUri, revisionDescriptor);
+ content.remove(slideToken, revisionDescriptors);
+ ObjectNode node = structure.retrieve(slideToken,
requestUri);
+ structure.remove(slideToken, node);
+ }
+ }
+
}
catch (SlideException e) {}
1.59 +3 -11
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/LockMethod.java
Index: LockMethod.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/LockMethod.java,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -r1.58 -r1.59
--- LockMethod.java 26 Feb 2004 15:45:55 -0000 1.58
+++ LockMethod.java 23 Mar 2004 13:47:15 -0000 1.59
@@ -373,14 +373,6 @@
// Creating the revision descriptor
content.create(slideToken, lockInfo_lockSubject,
revisionDescriptor, null);
-
- // HACK
- // Setting a max timeout when creating a lock-null
- // resource because the associated lock-null wouldn't
- // be automatically removed when the lock expires
- lockDate = new Date((new Date()).getTime()
- + ((long)MAX_TIMEOUT * 1000L));
-
}
NodeLock lockToken = null;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]