From: Henri Yandell Date: Sat, 2 Dec 2006 00:37:00 +0000 (+0000) Subject: Moving from Plexus Utils IOUtil to Commons IO IOUtils. close(..) becomes closeQuietly... X-Git-Tag: archiva-0.9-alpha-1~253 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5484a753336fc790ce70a7a6d1fb4b532798fc36;p=archiva.git Moving from Plexus Utils IOUtil to Commons IO IOUtils. close(..) becomes closeQuietly(..). copy(..) stays the same. In 1.3 (we're on 1.2 currently) copy(..) will throw an exception if more than MAXINT bytes are copied, but this is just a test case so I think we're safe. git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@481460 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-configuration/pom.xml b/archiva-configuration/pom.xml index efa11bdff..d64883dc0 100644 --- a/archiva-configuration/pom.xml +++ b/archiva-configuration/pom.xml @@ -44,6 +44,10 @@ commons-lang commons-lang + + commons-io + commons-io + diff --git a/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultConfigurationStore.java b/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultConfigurationStore.java index c185a4626..22513a86d 100644 --- a/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultConfigurationStore.java +++ b/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultConfigurationStore.java @@ -19,7 +19,7 @@ package org.apache.maven.archiva.configuration; import org.apache.maven.archiva.configuration.io.xpp3.ConfigurationXpp3Reader; import org.apache.maven.archiva.configuration.io.xpp3.ConfigurationXpp3Writer; import org.codehaus.plexus.logging.AbstractLogEnabled; -import org.codehaus.plexus.util.IOUtil; +import org.apache.commons.io.IOUtils; import org.apache.commons.lang.StringUtils; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; @@ -112,7 +112,7 @@ public class DefaultConfigurationStore } finally { - IOUtil.close( fileReader ); + IOUtils.closeQuietly( fileReader ); } } return configuration; @@ -166,7 +166,7 @@ public class DefaultConfigurationStore } finally { - IOUtil.close( fileWriter ); + IOUtils.closeQuietly( fileWriter ); } } diff --git a/archiva-converter/pom.xml b/archiva-converter/pom.xml index 842a2015c..bb3abd78b 100644 --- a/archiva-converter/pom.xml +++ b/archiva-converter/pom.xml @@ -47,5 +47,9 @@ plexus-i18n 1.0-beta-6 + + commons-io + commons-io + diff --git a/archiva-converter/src/main/java/org/apache/maven/archiva/converter/DefaultRepositoryConverter.java b/archiva-converter/src/main/java/org/apache/maven/archiva/converter/DefaultRepositoryConverter.java index 6f46b330a..3ee6b54e1 100644 --- a/archiva-converter/src/main/java/org/apache/maven/archiva/converter/DefaultRepositoryConverter.java +++ b/archiva-converter/src/main/java/org/apache/maven/archiva/converter/DefaultRepositoryConverter.java @@ -42,7 +42,7 @@ import org.codehaus.plexus.digest.Digester; import org.codehaus.plexus.digest.DigesterException; import org.codehaus.plexus.i18n.I18N; import org.codehaus.plexus.util.FileUtils; -import org.codehaus.plexus.util.IOUtil; +import org.apache.commons.io.IOUtils; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; import java.io.File; @@ -213,7 +213,7 @@ public class DefaultRepositoryConverter } finally { - IOUtil.close( writer ); + IOUtils.closeQuietly( writer ); } } } @@ -243,7 +243,7 @@ public class DefaultRepositoryConverter } finally { - IOUtil.close( fileReader ); + IOUtils.closeQuietly( fileReader ); } return metadata; } @@ -515,7 +515,7 @@ public class DefaultRepositoryConverter } finally { - IOUtil.close( writer ); + IOUtils.closeQuietly( writer ); } } } diff --git a/archiva-proxy/pom.xml b/archiva-proxy/pom.xml index 4f7f03f4b..8301da78c 100644 --- a/archiva-proxy/pom.xml +++ b/archiva-proxy/pom.xml @@ -53,5 +53,9 @@ 1.2_Java1.3 test + + commons-io + commons-io + diff --git a/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultProxyRequestHandler.java b/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultProxyRequestHandler.java index e0242794e..8d7eff60b 100644 --- a/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultProxyRequestHandler.java +++ b/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultProxyRequestHandler.java @@ -42,7 +42,7 @@ import org.codehaus.plexus.digest.DigestUtils; import org.codehaus.plexus.digest.DigesterException; import org.codehaus.plexus.logging.AbstractLogEnabled; import org.codehaus.plexus.util.FileUtils; -import org.codehaus.plexus.util.IOUtil; +import org.apache.commons.io.IOUtils; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; import java.io.File; @@ -407,7 +407,7 @@ public class DefaultProxyRequestHandler } finally { - IOUtil.close( fileReader ); + IOUtils.closeQuietly( fileReader ); } } @@ -440,7 +440,7 @@ public class DefaultProxyRequestHandler } finally { - IOUtil.close( fileReader ); + IOUtils.closeQuietly( fileReader ); } if ( changed ) @@ -457,7 +457,7 @@ public class DefaultProxyRequestHandler } finally { - IOUtil.close( fileWriter ); + IOUtils.closeQuietly( fileWriter ); } } } diff --git a/archiva-reports-standard/pom.xml b/archiva-reports-standard/pom.xml index ba86342df..3f1743f0d 100755 --- a/archiva-reports-standard/pom.xml +++ b/archiva-reports-standard/pom.xml @@ -70,6 +70,10 @@ commons-lang commons-lang + + commons-io + commons-io + diff --git a/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/processor/InvalidPomArtifactReportProcessor.java b/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/processor/InvalidPomArtifactReportProcessor.java index 19107c20c..f5277c5c0 100644 --- a/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/processor/InvalidPomArtifactReportProcessor.java +++ b/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/processor/InvalidPomArtifactReportProcessor.java @@ -22,7 +22,7 @@ import org.apache.maven.model.Model; import org.apache.maven.model.io.xpp3.MavenXpp3Reader; import org.apache.maven.archiva.reporting.processor.ArtifactReportProcessor; import org.apache.maven.archiva.reporting.database.ReportingDatabase; -import org.codehaus.plexus.util.IOUtil; +import org.apache.commons.io.IOUtils; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; import java.io.File; @@ -87,7 +87,7 @@ public class InvalidPomArtifactReportProcessor } finally { - IOUtil.close( reader ); + IOUtils.closeQuietly( reader ); } } } diff --git a/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/processor/LocationArtifactReportProcessor.java b/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/processor/LocationArtifactReportProcessor.java index c297e1c14..39a8d446b 100644 --- a/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/processor/LocationArtifactReportProcessor.java +++ b/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/processor/LocationArtifactReportProcessor.java @@ -25,7 +25,7 @@ import org.apache.maven.model.io.xpp3.MavenXpp3Reader; import org.apache.maven.project.MavenProjectBuilder; import org.apache.maven.archiva.reporting.processor.ArtifactReportProcessor; import org.apache.maven.archiva.reporting.database.ReportingDatabase; -import org.codehaus.plexus.util.IOUtil; +import org.apache.commons.io.IOUtils; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; import java.io.File; @@ -238,7 +238,7 @@ public class LocationArtifactReportProcessor } finally { - IOUtil.close( isReader ); + IOUtils.closeQuietly( isReader ); } return model; } diff --git a/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/store/DefaultReportingStore.java b/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/store/DefaultReportingStore.java index d1c1f5552..5e353f134 100644 --- a/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/store/DefaultReportingStore.java +++ b/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/store/DefaultReportingStore.java @@ -25,7 +25,7 @@ import org.apache.maven.archiva.reporting.store.ReportingStoreException; import org.apache.maven.archiva.reporting.database.ReportingDatabase; import org.apache.maven.artifact.repository.ArtifactRepository; import org.codehaus.plexus.logging.AbstractLogEnabled; -import org.codehaus.plexus.util.IOUtil; +import org.apache.commons.io.IOUtils; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; import java.io.File; @@ -94,7 +94,7 @@ public class DefaultReportingStore } finally { - IOUtil.close( fileReader ); + IOUtils.closeQuietly( fileReader ); } } @@ -136,7 +136,7 @@ public class DefaultReportingStore } finally { - IOUtil.close( fileWriter ); + IOUtils.closeQuietly( fileWriter ); } } } diff --git a/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/reporter/AbstractChecksumArtifactReporterTestCase.java b/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/reporter/AbstractChecksumArtifactReporterTestCase.java index 4974d8b39..a9dea3043 100644 --- a/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/reporter/AbstractChecksumArtifactReporterTestCase.java +++ b/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/reporter/AbstractChecksumArtifactReporterTestCase.java @@ -19,7 +19,7 @@ package org.apache.maven.archiva.reporting.reporter; import org.codehaus.plexus.digest.Digester; import org.codehaus.plexus.digest.DigesterException; import org.codehaus.plexus.util.FileUtils; -import org.codehaus.plexus.util.IOUtil; +import org.apache.commons.io.IOUtils; import org.apache.maven.archiva.reporting.AbstractRepositoryReportsTestCase; import java.io.BufferedOutputStream; @@ -136,7 +136,7 @@ public abstract class AbstractChecksumArtifactReporterTestCase BufferedReader in = new BufferedReader( new FileReader( filename1 ) ); out.putNextEntry( new JarEntry( filename1 ) ); - IOUtil.copy( in, out ); + IOUtils.copy( in, out ); in.close(); out.close(); diff --git a/archiva-sandbox/archiva-repository-assembler/pom.xml b/archiva-sandbox/archiva-repository-assembler/pom.xml index be8c763ce..f505f7b99 100644 --- a/archiva-sandbox/archiva-repository-assembler/pom.xml +++ b/archiva-sandbox/archiva-repository-assembler/pom.xml @@ -59,5 +59,9 @@ org.codehaus.plexus plexus-container-default + + commons-io + commons-io + diff --git a/archiva-sandbox/archiva-repository-assembler/src/main/java/org/apache/maven/archiva/repository/assembly/DefaultRepositoryAssembler.java b/archiva-sandbox/archiva-repository-assembler/src/main/java/org/apache/maven/archiva/repository/assembly/DefaultRepositoryAssembler.java index 38d3ac7b0..8ec5c8547 100644 --- a/archiva-sandbox/archiva-repository-assembler/src/main/java/org/apache/maven/archiva/repository/assembly/DefaultRepositoryAssembler.java +++ b/archiva-sandbox/archiva-repository-assembler/src/main/java/org/apache/maven/archiva/repository/assembly/DefaultRepositoryAssembler.java @@ -32,7 +32,7 @@ import org.apache.maven.artifact.resolver.filter.ArtifactFilter; import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter; import org.codehaus.plexus.logging.AbstractLogEnabled; import org.codehaus.plexus.util.FileUtils; -import org.codehaus.plexus.util.IOUtil; +import org.apache.commons.io.IOUtils; import java.io.File; import java.io.FileWriter; @@ -268,7 +268,7 @@ public class DefaultRepositoryAssembler } finally { - IOUtil.close( writer ); + IOUtils.closeQuietly( writer ); } try diff --git a/pom.xml b/pom.xml index 6025dcb26..a8b3b7d07 100644 --- a/pom.xml +++ b/pom.xml @@ -346,6 +346,11 @@ commons-lang 2.2 + + commons-io + commons-io + 1.2 +