From 7cc7854a2671ef1476fc742fafb233f00836c46a Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Wed, 25 Jun 2014 16:27:46 +1000 Subject: [PATCH] revert previous commit as 2.x was not affected in fact --- .../java/org/apache/archiva/webdav/ArchivaDavResource.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResource.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResource.java index 2257467b4..559f160d8 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResource.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResource.java @@ -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 ) -- 2.39.5