]> source.dussan.org Git - archiva.git/commitdiff
revert previous commit as 2.x was not affected in fact
authorOlivier Lamy <olamy@apache.org>
Wed, 25 Jun 2014 06:27:46 +0000 (16:27 +1000)
committerOlivier Lamy <olamy@apache.org>
Wed, 25 Jun 2014 06:27:46 +0000 (16:27 +1000)
archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResource.java

index 2257467b42854eaba34472bce8c8180ca88c53f0..559f160d80f2251076f024d513ddc232369ea305 100644 (file)
@@ -212,8 +212,7 @@ public class ArchivaDavResource
     {
         if ( !isCollection() )
         {
-            //outputContext.setContentLength( localResource.length() );
-            outputContext.setProperty( DavConstants.HEADER_CONTENT_LENGTH, Long.toString( localResource.length() ) );
+            outputContext.setContentLength( localResource.length() );
             outputContext.setContentType( mimeTypes.getMimeType( localResource.getName() ) );
         }
 
@@ -331,8 +330,7 @@ public class ArchivaDavResource
             }
 
             // TODO: a bad deployment shouldn't delete an existing file - do we need to write to a temporary location first?
-            //long expectedContentLength = inputContext.getContentLength();
-            long expectedContentLength = Long.parseLong( inputContext.getProperty( DavConstants.HEADER_CONTENT_LENGTH ) );
+            long expectedContentLength = inputContext.getContentLength();
             long actualContentLength = localFile.length();
             // length of -1 is given for a chunked request or unknown length, in which case we accept what was uploaded
             if ( expectedContentLength >= 0 && expectedContentLength != actualContentLength )