* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
*/
import junit.framework.AssertionFailedError;
+
+import org.apache.commons.io.IOUtils;
import org.apache.maven.archiva.model.ArchivaArtifact;
import org.apache.maven.archiva.model.ArchivaArtifactJavaDetails;
import org.apache.maven.archiva.model.platform.JavaArtifactHelper;
-import org.codehaus.plexus.util.IOUtil;
import java.io.BufferedReader;
import java.io.File;
}
finally
{
- IOUtil.close( reader );
- IOUtil.close( freader );
+ IOUtils.closeQuietly( reader );
+ IOUtils.closeQuietly( freader );
}
// cache.put( artifact, record );
* under the License.
*/
+import org.apache.commons.io.IOUtils;
import org.apache.maven.archiva.model.ArchivaArtifact;
import org.apache.maven.archiva.model.ArchivaArtifactJavaDetails;
import org.apache.maven.archiva.model.platform.JavaArtifactHelper;
-import org.codehaus.plexus.util.IOUtil;
import java.io.BufferedReader;
import java.io.File;
}
finally
{
- IOUtil.close( reader );
- IOUtil.close( freader );
+ IOUtils.closeQuietly( reader );
+ IOUtils.closeQuietly( freader );
}
return record;
<name>Archiva Transactions</name>
<description>API for managing transaction.</description>
<dependencies>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ </dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-digest</artifactId>
* under the License.
*/
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
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 java.io.File;
import java.io.FileOutputStream;
}
}
+ /**
+ * TODO: Remove in favor of using FileUtils directly.
+ */
protected void writeStringToFile( 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 );
}
/**
* under the License.
*/
+import org.apache.commons.io.IOUtils;
import org.codehaus.plexus.PlexusTestCase;
import org.codehaus.plexus.digest.Digester;
-import org.codehaus.plexus.util.IOUtil;
import java.io.File;
import java.io.FileInputStream;
try
{
in = new FileInputStream( file );
- return IOUtil.toString( in );
+ return IOUtils.toString( in );
}
finally
{