mirror of https://github.com/apache/archiva.git
MRM-709: Use commons-io instead of Plexus Utils
* Fixing build error. git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@637001 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4c114bee2f
commit
cd88ed03c4
|
@ -19,6 +19,7 @@ package org.apache.maven.archiva.transaction;
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import org.apache.commons.io.FileUtils;
|
||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
import org.codehaus.plexus.PlexusTestCase;
|
import org.codehaus.plexus.PlexusTestCase;
|
||||||
import org.codehaus.plexus.digest.Digester;
|
import org.codehaus.plexus.digest.Digester;
|
||||||
|
@ -81,30 +82,12 @@ public abstract class AbstractFileEventTest
|
||||||
protected String readFile( File file )
|
protected String readFile( File file )
|
||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
FileInputStream in = null;
|
return FileUtils.readFileToString( file );
|
||||||
try
|
|
||||||
{
|
|
||||||
in = new FileInputStream( file );
|
|
||||||
return IOUtils.toString( in );
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
IOUtil.close( in );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void writeFile( File file, String content )
|
protected void writeFile( File file, String content )
|
||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
FileOutputStream out = null;
|
FileUtils.writeStringToFile( file, content );
|
||||||
try
|
|
||||||
{
|
|
||||||
out = new FileOutputStream( file );
|
|
||||||
IOUtil.copy( content, out );
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
IOUtil.close( out );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue