jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r633803 - /jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/header/OverwriteHeader.java
Date Wed, 05 Mar 2008 10:01:52 GMT
Author: angela
Date: Wed Mar  5 02:01:46 2008
New Revision: 633803

URL: http://svn.apache.org/viewvc?rev=633803&view=rev
Log:
JCR-1439: MOVE method returns error 412 Precondition Failed

Modified:
    jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/header/OverwriteHeader.java

Modified: jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/header/OverwriteHeader.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/header/OverwriteHeader.java?rev=633803&r1=633802&r2=633803&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/header/OverwriteHeader.java
(original)
+++ jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/header/OverwriteHeader.java
Wed Mar  5 02:01:46 2008
@@ -32,16 +32,32 @@
     public static final String OVERWRITE_TRUE = "T";
     public static final String OVERWRITE_FALSE = "F";
 
-    private boolean doOverwrite;
+    /**
+     * Set 'doOverwrite' to <code>true</code> by default. See RFC 2518:
+     * "If the overwrite header is not included in a COPY or MOVE request then
+     * the resource MUST treat the request as if it has an overwrite header of
+     * value {@link #OVERWRITE_TRUE}".
+     */
+    private final boolean doOverwrite;
 
     public OverwriteHeader(boolean doOverwrite) {
         this.doOverwrite = doOverwrite;
     }
 
+    /**
+     * Create a new <code>OverwriteHeader</code> for the given request object.
+     * If the latter does not contain an "Overwrite" header field, the default
+     * applies, which is {@link #OVERWRITE_TRUE} according to RFC 2518.
+     *
+     * @param request
+     */
     public OverwriteHeader(HttpServletRequest request) {
         String overwriteHeader = request.getHeader(DavConstants.HEADER_OVERWRITE);
         if (overwriteHeader != null) {
             doOverwrite = overwriteHeader.equalsIgnoreCase(OVERWRITE_TRUE);
+        } else {
+            // no Overwrite header -> default is 'true'
+            doOverwrite = true;
         }
     }
 



Mime
View raw message