diff --git a/p2-maven-plugin/src/main/java/org/eclipse/tycho/p2maven/transport/TychoRepositoryTransport.java b/p2-maven-plugin/src/main/java/org/eclipse/tycho/p2maven/transport/TychoRepositoryTransport.java index b88d3d0d00..89dc8e7eca 100644 --- a/p2-maven-plugin/src/main/java/org/eclipse/tycho/p2maven/transport/TychoRepositoryTransport.java +++ b/p2-maven-plugin/src/main/java/org/eclipse/tycho/p2maven/transport/TychoRepositoryTransport.java @@ -29,7 +29,6 @@ import java.util.concurrent.atomic.LongAdder; import org.apache.commons.io.FileUtils; -import org.apache.commons.io.IOUtils; import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.logging.Logger; @@ -99,7 +98,7 @@ public IStatus download(URI toDownload, OutputStream target, IProgressMonitor mo try { DownloadStatusOutputStream statusOutputStream = new DownloadStatusOutputStream(target, "Download of " + toDownload); - IOUtils.copy(stream(toDownload, monitor), statusOutputStream); + stream(toDownload, monitor).transferTo(statusOutputStream); DownloadStatus downloadStatus = statusOutputStream.getStatus(); if (cacheConfig.isInteractive()) { logger.info( diff --git a/tycho-artifactcomparator/src/main/java/org/eclipse/tycho/artifactcomparator/ComparatorInputStream.java b/tycho-artifactcomparator/src/main/java/org/eclipse/tycho/artifactcomparator/ComparatorInputStream.java index 3c11c3301e..fbe62dd660 100644 --- a/tycho-artifactcomparator/src/main/java/org/eclipse/tycho/artifactcomparator/ComparatorInputStream.java +++ b/tycho-artifactcomparator/src/main/java/org/eclipse/tycho/artifactcomparator/ComparatorInputStream.java @@ -18,8 +18,6 @@ import java.nio.charset.Charset; import java.util.Arrays; -import org.apache.commons.io.IOUtils; - /** * Input stream to carry some important information for comparison and allows direct access to the * underlying buffer. @@ -32,7 +30,7 @@ public class ComparatorInputStream extends ByteArrayInputStream { private final byte[] content; public ComparatorInputStream(InputStream stream) throws IOException { - this(IOUtils.toByteArray(stream)); + this(stream.readAllBytes()); } public ComparatorInputStream(byte[] content) { diff --git a/tycho-its/src/test/java/org/eclipse/tycho/test/product/Tycho188P2EnabledRcpTest.java b/tycho-its/src/test/java/org/eclipse/tycho/test/product/Tycho188P2EnabledRcpTest.java index 73f46e092a..63546b8895 100644 --- a/tycho-its/src/test/java/org/eclipse/tycho/test/product/Tycho188P2EnabledRcpTest.java +++ b/tycho-its/src/test/java/org/eclipse/tycho/test/product/Tycho188P2EnabledRcpTest.java @@ -28,7 +28,6 @@ import java.util.Set; import org.apache.maven.it.Verifier; -import org.codehaus.plexus.util.IOUtil; import org.eclipse.tycho.TargetEnvironment; import org.eclipse.tycho.test.AbstractTychoIntegrationTest; import org.eclipse.tycho.test.util.ArchiveContentUtil; @@ -258,8 +257,7 @@ static private void assertTotalZipArtifacts(final Verifier verifier, final int e public static Properties openPropertiesFromZip(File zipFile, String propertyFile) throws Exception { Properties configIni = new Properties(); - configIni.load( - new ByteArrayInputStream(IOUtil.toByteArray(ArchiveContentUtil.getFileContent(zipFile, propertyFile)))); + configIni.load(new ByteArrayInputStream(ArchiveContentUtil.getFileContent(zipFile, propertyFile).getBytes())); return configIni; } diff --git a/tycho-p2/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/tar/TarGzArchiver.java b/tycho-p2/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/tar/TarGzArchiver.java index a92b9a8270..ab42871b17 100644 --- a/tycho-p2/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/tar/TarGzArchiver.java +++ b/tycho-p2/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/tar/TarGzArchiver.java @@ -30,7 +30,6 @@ import org.apache.commons.compress.archivers.tar.TarArchiveEntry; import org.apache.commons.compress.archivers.tar.TarArchiveOutputStream; import org.apache.commons.compress.compressors.gzip.GzipCompressorOutputStream; -import org.apache.commons.compress.utils.IOUtils; import org.apache.maven.plugin.logging.Log; import org.apache.maven.plugin.logging.SystemStreamLog; @@ -163,7 +162,7 @@ private PosixFileAttributes getAttributes(File source) { private static void copyFileContentToTarStream(File source, TarArchiveOutputStream tarStream) throws IOException { try (BufferedInputStream sourceStream = new BufferedInputStream(new FileInputStream(source))) { - IOUtils.copy(sourceStream, tarStream); + sourceStream.transferTo(tarStream); } } diff --git a/tycho-p2/tycho-p2-director-plugin/src/test/java/org/eclipse/tycho/plugins/tar/TarGzArchiverTest.java b/tycho-p2/tycho-p2-director-plugin/src/test/java/org/eclipse/tycho/plugins/tar/TarGzArchiverTest.java index 4b42070b94..94db68ef92 100644 --- a/tycho-p2/tycho-p2-director-plugin/src/test/java/org/eclipse/tycho/plugins/tar/TarGzArchiverTest.java +++ b/tycho-p2/tycho-p2-director-plugin/src/test/java/org/eclipse/tycho/plugins/tar/TarGzArchiverTest.java @@ -36,7 +36,6 @@ import org.apache.commons.compress.archivers.tar.TarArchiveEntry; import org.apache.commons.compress.archivers.tar.TarArchiveInputStream; import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream; -import org.apache.commons.compress.utils.IOUtils; import org.junit.Assume; import org.junit.Before; import org.junit.Rule; @@ -226,7 +225,7 @@ private byte[] getTarEntry(String name) throws IOException { while ((tarEntry = tarStream.getNextTarEntry()) != null) { if (name.equals(tarEntry.getName())) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); - IOUtils.copy(tarStream, baos); + tarStream.transferTo(baos); return baos.toByteArray(); } }