diff options
author | Brett Porter <brett@apache.org> | 2014-06-25 14:22:18 +1000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2014-06-25 16:23:53 +1000 |
commit | 48a42e895ad413c5cf9e08382368d58661b20110 (patch) | |
tree | e66522e2af063f0204f13714707dfddc0efe7199 /archiva-modules | |
parent | c648adb3061202572de0fa575150e48ce4c486de (diff) | |
download | archiva-48a42e895ad413c5cf9e08382368d58661b20110.tar.gz archiva-48a42e895ad413c5cf9e08382368d58661b20110.zip |
[MRM-1796] support artifacts larger than 4G
[MRM-1796] support artifacts larger than 4G
Diffstat (limited to 'archiva-modules')
-rw-r--r-- | archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResource.java | 7 |
1 files changed, 5 insertions, 2 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 c1c73eee8..2257467b4 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 @@ -35,6 +35,7 @@ import org.apache.archiva.webdav.util.MimeTypes; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import org.apache.jackrabbit.util.Text; +import org.apache.jackrabbit.webdav.DavConstants; import org.apache.jackrabbit.webdav.DavException; import org.apache.jackrabbit.webdav.DavResource; import org.apache.jackrabbit.webdav.DavResourceFactory; @@ -211,7 +212,8 @@ public class ArchivaDavResource { if ( !isCollection() ) { - outputContext.setContentLength( localResource.length() ); + //outputContext.setContentLength( localResource.length() ); + outputContext.setProperty( DavConstants.HEADER_CONTENT_LENGTH, Long.toString( localResource.length() ) ); outputContext.setContentType( mimeTypes.getMimeType( localResource.getName() ) ); } @@ -329,7 +331,8 @@ 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 = inputContext.getContentLength(); + long expectedContentLength = Long.parseLong( inputContext.getProperty( DavConstants.HEADER_CONTENT_LENGTH ) ); 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 ) |