From 69a394c10fab56ea32a5876126a63988ce8e83fe Mon Sep 17 00:00:00 2001 From: Henri Yandell Date: Sat, 9 Dec 2006 01:01:08 +0000 Subject: [PATCH] Moved some of the methods over to IO FileUtils. There is no DirectoryScanner yet or a copyDirectoryStructure method. See https://issues.apache.org/jira/browse/IO-105 for a request for the latter. git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@484870 13f79535-47bb-0310-9956-ffa450edef68 --- .../processor/ChecksumArtifactReportProcessor.java | 4 ++-- .../processor/ChecksumMetadataReportProcessor.java | 4 ++-- .../DuplicateArtifactFileReportProcessorTest.java | 2 +- .../processor/OldSnapshotArtifactReportProcessorTest.java | 8 ++++---- .../AbstractChecksumArtifactReporterTestCase.java | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/processor/ChecksumArtifactReportProcessor.java b/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/processor/ChecksumArtifactReportProcessor.java index 5dc3e2645..6bbc035f2 100644 --- a/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/processor/ChecksumArtifactReportProcessor.java +++ b/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/processor/ChecksumArtifactReportProcessor.java @@ -23,7 +23,7 @@ import org.apache.maven.archiva.reporting.processor.ArtifactReportProcessor; import org.apache.maven.archiva.reporting.database.ReportingDatabase; import org.codehaus.plexus.digest.Digester; import org.codehaus.plexus.digest.DigesterException; -import org.codehaus.plexus.util.FileUtils; +import org.apache.commons.io.FileUtils; import java.io.File; import java.io.IOException; @@ -77,7 +77,7 @@ public class ChecksumArtifactReportProcessor { try { - digester.verify( file, FileUtils.fileRead( checksumFile ) ); + digester.verify( file, FileUtils.readFileToString( checksumFile, null ) ); } catch ( DigesterException e ) { diff --git a/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/processor/ChecksumMetadataReportProcessor.java b/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/processor/ChecksumMetadataReportProcessor.java index 81a558e8b..fe239f36d 100644 --- a/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/processor/ChecksumMetadataReportProcessor.java +++ b/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/processor/ChecksumMetadataReportProcessor.java @@ -22,7 +22,7 @@ import org.apache.maven.archiva.reporting.processor.MetadataReportProcessor; import org.apache.maven.archiva.reporting.database.ReportingDatabase; import org.codehaus.plexus.digest.Digester; import org.codehaus.plexus.digest.DigesterException; -import org.codehaus.plexus.util.FileUtils; +import org.apache.commons.io.FileUtils; import java.io.File; import java.io.IOException; @@ -78,7 +78,7 @@ public class ChecksumMetadataReportProcessor { try { - digester.verify( file, FileUtils.fileRead( checksumFile ) ); + digester.verify( file, FileUtils.readFileToString( checksumFile, null ) ); } catch ( DigesterException e ) { diff --git a/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/processor/DuplicateArtifactFileReportProcessorTest.java b/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/processor/DuplicateArtifactFileReportProcessorTest.java index 5f8e39dae..107d614ef 100644 --- a/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/processor/DuplicateArtifactFileReportProcessorTest.java +++ b/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/processor/DuplicateArtifactFileReportProcessorTest.java @@ -26,7 +26,7 @@ import org.apache.maven.archiva.reporting.database.ReportingDatabase; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.factory.ArtifactFactory; import org.apache.maven.model.Model; -import org.codehaus.plexus.util.FileUtils; +import org.apache.commons.io.FileUtils; import java.io.File; import java.util.Collections; diff --git a/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/processor/OldSnapshotArtifactReportProcessorTest.java b/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/processor/OldSnapshotArtifactReportProcessorTest.java index 55a5be32c..9f7cb1da0 100644 --- a/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/processor/OldSnapshotArtifactReportProcessorTest.java +++ b/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/processor/OldSnapshotArtifactReportProcessorTest.java @@ -23,7 +23,7 @@ import org.apache.maven.archiva.reporting.processor.ArtifactReportProcessor; import org.apache.maven.archiva.reporting.AbstractRepositoryReportsTestCase; import org.apache.maven.archiva.reporting.database.ReportingDatabase; import org.apache.maven.artifact.Artifact; -import org.codehaus.plexus.util.FileUtils; +import org.apache.commons.io.FileUtils; import java.io.File; import java.text.SimpleDateFormat; @@ -109,7 +109,7 @@ public class OldSnapshotArtifactReportProcessorTest dir.mkdirs(); String date = new SimpleDateFormat( "yyyyMMdd.HHmmss" ).format( new Date() ); - FileUtils.fileWrite( new File( dir, "artifactId-1.0-alpha-1-" + date + "-1.jar" ).getAbsolutePath(), "foo" ); + FileUtils.writeStringToFile( new File( dir, "artifactId-1.0-alpha-1-" + date + "-1.jar" ), "foo", null ); Artifact artifact = createArtifactFromRepository( repository, "groupId", "artifactId", "1.0-alpha-1-" + date + "-1" ); @@ -129,8 +129,8 @@ public class OldSnapshotArtifactReportProcessorTest String date = new SimpleDateFormat( "yyyyMMdd.HHmmss" ).format( new Date() ); for ( int i = 1; i <= 5; i++ ) { - FileUtils.fileWrite( new File( dir, "artifactId-1.0-alpha-1-" + date + "-" + i + ".jar" ).getAbsolutePath(), - "foo" ); + FileUtils.writeStringToFile( new File( dir, "artifactId-1.0-alpha-1-" + date + "-" + i + ".jar" ), + "foo", null ); } for ( int i = 1; i <= 5; i++ ) 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 a9dea3043..e6547b4f0 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 @@ -18,7 +18,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.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import org.apache.maven.archiva.reporting.AbstractRepositoryReportsTestCase; -- 2.39.5