From: Maria Odea B. Ching Date: Thu, 12 May 2011 09:08:58 +0000 (+0000) Subject: [MRM-1469] used IOUtils.copy(..) for artifact upload from webapp X-Git-Tag: archiva-1.3.5^2~4 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=41f14160026be4b7852b3146b23583f43223c26c;p=archiva.git [MRM-1469] used IOUtils.copy(..) for artifact upload from webapp git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/archiva-1.3.x@1102210 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/UploadAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/UploadAction.java index fcf3d54fe..0049e8436 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/UploadAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/UploadAction.java @@ -35,6 +35,7 @@ import java.util.TimeZone; import org.apache.archiva.checksum.ChecksumAlgorithm; import org.apache.archiva.checksum.ChecksummedFile; import org.apache.commons.io.FilenameUtils; +import org.apache.commons.io.IOUtils; import org.apache.commons.lang.StringUtils; import org.apache.maven.archiva.common.utils.VersionComparator; import org.apache.maven.archiva.common.utils.VersionUtil; @@ -461,12 +462,7 @@ public class UploadAction try { - int i; - while ( ( i = input.read() ) != -1 ) - { - out.write( i ); - } - out.flush(); + IOUtils.copy( input, out ); } finally {