MRM-709: Use commons-io instead of Plexus Utils

* Using FileUtils from commons-io.

git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@630589 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Joakim Erdfelt 2008-02-24 05:07:26 +00:00
parent 1412e7ffd1
commit 40770e8d07
3 changed files with 13 additions and 29 deletions

View File

@ -28,6 +28,10 @@
<name>Archiva Artifact Converter</name>
<description>Converts between Legacy and Modern Layout Artifacts.</description>
<dependencies>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-repository-metadata</artifactId>

View File

@ -19,13 +19,11 @@ package org.apache.maven.archiva.converter.artifact;
* under the License.
*/
import org.codehaus.plexus.util.IOUtil;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.commons.io.FileUtils;
/**
* AsciiFileUtil - conveinence utility for reading / writing ascii files.
*
@ -45,16 +43,7 @@ public class AsciiFileUtil
public static String readFile( File file )
throws IOException
{
FileInputStream in = null;
try
{
in = new FileInputStream( file );
return IOUtil.toString( in );
}
finally
{
IOUtil.close( in );
}
return FileUtils.readFileToString( file, null );
}
/**
@ -67,15 +56,6 @@ public class AsciiFileUtil
public static void writeFile( File file, String content )
throws IOException
{
FileOutputStream out = null;
try
{
out = new FileOutputStream( file );
IOUtil.copy( content, out );
}
finally
{
IOUtil.close( out );
}
FileUtils.writeStringToFile( file, content, null );
}
}

View File

@ -19,6 +19,8 @@ package org.apache.maven.archiva.converter.artifact;
* under the License.
*/
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.maven.archiva.transaction.FileTransaction;
import org.apache.maven.archiva.transaction.TransactionException;
import org.apache.maven.artifact.Artifact;
@ -41,8 +43,6 @@ import org.apache.maven.model.converter.PomTranslationException;
import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
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.codehaus.plexus.util.xml.pull.XmlPullParserException;
import java.io.File;
@ -275,7 +275,7 @@ public class LegacyToDefaultConverter
}
finally
{
IOUtil.close( writer );
IOUtils.closeQuietly( writer );
}
}
}
@ -411,7 +411,7 @@ public class LegacyToDefaultConverter
}
finally
{
IOUtil.close( fileReader );
IOUtils.closeQuietly( fileReader );
}
return metadata;
}
@ -583,7 +583,7 @@ public class LegacyToDefaultConverter
}
finally
{
IOUtil.close( writer );
IOUtils.closeQuietly( writer );
}
}
}