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 ju...@apache.org on 2001/11/06 13:26:46 UTC
cvs commit: jakarta-slide/src/webdav/server/org/apache/slide/webdav/method PostMethod.java
juergen 01/11/06 04:26:46
Modified: src/webdav/server/org/apache/slide/webdav/method
PostMethod.java
Log:
post behaves like a put, if the resource is a document or does not exist. If the resource is a collection a 409 is returned.
Reason: more compatibility with some clients, sending a post instead of a put.
Revision Changes Path
1.4 +22 -19 jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PostMethod.java
Index: PostMethod.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PostMethod.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- PostMethod.java 2001/08/01 16:30:58 1.3
+++ PostMethod.java 2001/11/06 12:26:46 1.4
@@ -1,13 +1,13 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PostMethod.java,v 1.3 2001/08/01 16:30:58 cmlenz Exp $
- * $Revision: 1.3 $
- * $Date: 2001/08/01 16:30:58 $
+ * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PostMethod.java,v 1.4 2001/11/06 12:26:46 juergen Exp $
+ * $Revision: 1.4 $
+ * $Date: 2001/11/06 12:26:46 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -15,7 +15,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -23,15 +23,15 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
- * any, must include the following acknowlegement:
- * "This product includes software developed by the
+ * any, must include the following acknowlegement:
+ * "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
- * from this software without prior written permission. For written
+ * from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
@@ -59,7 +59,7 @@
*
* [Additional notices, if required by prior licensing conditions]
*
- */
+ */
package org.apache.slide.webdav.method;
@@ -74,10 +74,10 @@
/**
* POST method.
- *
+ *
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
*/
-public class PostMethod extends WebdavMethod {
+public class PostMethod extends PutMethod {
// ----------------------------------------------------------- Constructors
@@ -85,17 +85,20 @@
public PostMethod(NamespaceAccessToken token, HttpServletRequest req,
HttpServletResponse resp, WebdavServletConfig config) {
- super(token, req, resp, config);
+ super(token, req, resp, config);
}
- protected void parseRequest()
- throws WebdavException {
- // Don't know what to do there.
- // RFC is extremely vague on the subject ...
- }
- protected void executeRequest()
- throws WebdavException {
+ protected void executeRequest()
+ throws WebdavException {
+
+ if (!isCollection(requestUri)) {
+ super.executeRequest();
+ }
+ else {
+ resp.setStatus(WebdavStatus.SC_CONFLICT);
+ }
+
}
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>