<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>
* 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.
*
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 );
}
/**
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 );
}
}
* 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;
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;
}
finally
{
- IOUtil.close( writer );
+ IOUtils.closeQuietly( writer );
}
}
}
}
finally
{
- IOUtil.close( fileReader );
+ IOUtils.closeQuietly( fileReader );
}
return metadata;
}
}
finally
{
- IOUtil.close( writer );
+ IOUtils.closeQuietly( writer );
}
}
}