diff options
author | Maria Odea B. Ching <oching@apache.org> | 2011-02-16 03:30:53 +0000 |
---|---|---|
committer | Maria Odea B. Ching <oching@apache.org> | 2011-02-16 03:30:53 +0000 |
commit | cb61344408064966c86d2c4269feae6a56f59d20 (patch) | |
tree | ed9f29287789cf99156fb0b499d0fc61c27abaf1 /archiva-modules | |
parent | 8f7c957341a00d00fbb46a8d1a02e056790d7c73 (diff) | |
download | archiva-cb61344408064966c86d2c4269feae6a56f59d20.tar.gz archiva-cb61344408064966c86d2c4269feae6a56f59d20.zip |
used IOUtils copy for merging so streams are buffered
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1071136 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
-rw-r--r-- | archiva-modules/plugins/stage-repository-merge/src/main/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMerger.java | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/archiva-modules/plugins/stage-repository-merge/src/main/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMerger.java b/archiva-modules/plugins/stage-repository-merge/src/main/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMerger.java index a0ef048b8..735e35e26 100644 --- a/archiva-modules/plugins/stage-repository-merge/src/main/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMerger.java +++ b/archiva-modules/plugins/stage-repository-merge/src/main/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMerger.java @@ -24,6 +24,7 @@ import org.apache.archiva.metadata.repository.MetadataRepository; import org.apache.archiva.metadata.repository.filter.Filter; import org.apache.archiva.metadata.repository.filter.IncludesFilter; import org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator; +import org.apache.commons.io.IOUtils; import org.apache.maven.archiva.common.utils.VersionComparator; import org.apache.maven.archiva.common.utils.VersionUtil; import org.apache.maven.archiva.configuration.ArchivaConfiguration; @@ -227,20 +228,8 @@ public class Maven2RepositoryMerger FileOutputStream out = new FileOutputStream( targetFile ); FileInputStream input = new FileInputStream( sourceFile ); - try - { - int i; - while ( ( i = input.read() ) != -1 ) - { - out.write( i ); - } - out.flush(); - } - finally - { - out.close(); - input.close(); - } + // IOUtils internally buffers the streams + IOUtils.copy( input, out ); } private void updateProjectMetadata( File projectMetaDataFileIntargetRepo, ArtifactMetadata artifactMetadata, |