juergen 02/05/15 22:20:58
Modified: src/webdav/server/org/apache/slide/webdav/util
PropertyHelper.java
Log:
Extracted method computeLockDiscovery(NodeLock) which can be used by the LockMethod.
(ralf)
Revision Changes Path
1.21 +33 -7
jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/PropertyHelper.java
Index: PropertyHelper.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/PropertyHelper.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- PropertyHelper.java 15 May 2002 06:41:59 -0000 1.20
+++ PropertyHelper.java 16 May 2002 05:20:58 -0000 1.21
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/PropertyHelper.java,v
1.20 2002/05/15 06:41:59 juergen Exp $
- * $Revision: 1.20 $
- * $Date: 2002/05/15 06:41:59 $
+ * $Header:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/PropertyHelper.java,v
1.21 2002/05/16 05:20:58 juergen Exp $
+ * $Revision: 1.21 $
+ * $Date: 2002/05/16 05:20:58 $
*
* ====================================================================
*
@@ -1120,17 +1120,43 @@
*/
public XMLValue computeLockDiscovery(NodeRevisionDescriptors
revisionDescriptors, NodeRevisionDescriptor revisionDescriptor, String contextPath,
String serverURL) throws ObjectLockedException, RevisionDescriptorNotFoundException,
ServiceAccessException, LinkedObjectNotFoundException, AccessDeniedException,
ObjectNotFoundException, LockTokenNotFoundException, JDOMException {
- XMLValue xmlValue = new XMLValue();
-
Lock lock = nsaToken.getLockHelper();
- Security security = nsaToken.getSecurityHelper();
-
NodeLock objectLockToken = null;
Enumeration lockTokens = lock.enumerateLocks(sToken,
revisionDescriptors.getUri(), true);
if (lockTokens.hasMoreElements()) {
objectLockToken = (NodeLock) lockTokens.nextElement();
}
+ return computeLockDiscovery(objectLockToken, serverURL, contextPath);
+ }
+
+ /**
+ * Returns an XMLValue containing the value of the
<code><lockdiscovery></code>
+ * property.
+ *
+ * @param objectLockToken the NodeLock for which to compute the value
+ * of the <code><lockdiscovery></code>
property.
+ * @param contextPath the context path of the
NodeRevisionDescriptors' uri.
+ * The concatenation of <code>serverURL</code>/
+ *
<code>contextPath</code>/<code>revisionDescriptor.getUri()</code>
+ * gives the absolute URL of the resource.
+ * @param serverURL the URL of the server (e.g.
<code>http://www.abc.com</code>).
+ *
+ * @return the value of the <code><lockdiscovery></code> property.
+ *
+ * @throws ObjectLockedException
+ * @throws RevisionDescriptorNotFoundException
+ * @throws ServiceAccessException
+ * @throws LinkedObjectNotFoundException
+ * @throws AccessDeniedException
+ * @throws ObjectNotFoundException
+ * @throws JDOMException
+ */
+ public XMLValue computeLockDiscovery(NodeLock objectLockToken, String
serverURL, String contextPath) {
+
+ XMLValue xmlValue = new XMLValue();
+ Security security = nsaToken.getSecurityHelper();
+
if (objectLockToken != null) {
Element activelock = new Element(E_ACTIVELOCK, davNamespace);
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>