juergen 02/04/30 02:10:24
Modified: src/webdav/server/org/apache/slide/webdav/method
GetMethod.java
Log:
Send appropriate precondition violation if a revision with the label specified in
the "Label" header was not found.
(ralf)
Revision Changes Path
1.26 +15 -4
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/GetMethod.java
Index: GetMethod.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/GetMethod.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- GetMethod.java 30 Apr 2002 08:47:10 -0000 1.25
+++ GetMethod.java 30 Apr 2002 09:10:24 -0000 1.26
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/GetMethod.java,v
1.25 2002/04/30 08:47:10 juergen Exp $
- * $Revision: 1.25 $
- * $Date: 2002/04/30 08:47:10 $
+ * $Header:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/GetMethod.java,v
1.26 2002/04/30 09:10:24 juergen Exp $
+ * $Revision: 1.26 $
+ * $Date: 2002/04/30 09:10:24 $
*
* ====================================================================
*
@@ -90,6 +90,9 @@
import org.apache.slide.webdav.WebdavServletConfig;
import org.apache.slide.webdav.util.VersioningHelper;
import org.apache.slide.webdav.util.DeltavConstants;
+import org.apache.slide.webdav.util.LabeledRevisionNotFoundException;
+import org.apache.slide.webdav.util.PreconditionViolationException;
+import org.apache.slide.webdav.util.ViolatedPrecondition;
import org.apache.slide.util.Configuration;
/**
@@ -179,17 +182,25 @@
* Parse XML request.
*/
protected void parseRequest()
- throws WebdavException {
+ throws WebdavException, IOException {
resourcePath = requestUri;
if (resourcePath == null) {
resourcePath = "/";
}
+
+ // evaluate "Label" header
if (Configuration.useVersionControl()) {
try {
resourcePath = vHelp.getLabeledResourceUri(resourcePath,
req.getHeader(DeltavConstants.H_LABEL));
}
+ catch (LabeledRevisionNotFoundException e) {
+ sendPreconditionViolation(new PreconditionViolationException(new
ViolatedPrecondition(DeltavConstants.C_MUST_SELECT_VERSION_IN_HISTORY,
WebdavStatus.SC_CONFLICT),
+
resourcePath));
+ throw new WebdavException(getErrorCode((Exception)e));
+ }
catch (SlideException e) {
+ resp.sendError(getErrorCode((Exception)e));
throw new WebdavException(getErrorCode((Exception)e));
}
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>