Skip to content
Permalink
Browse files
Use Plexus FileUtils instead of custom code.
  • Loading branch information
garydgregory committed May 17, 2018
1 parent 1feed28 commit 5082cd05fef5baa24e905cb2d701f8c0939610d7
Showing 1 changed file with 2 additions and 12 deletions.
@@ -78,19 +78,9 @@ public static void initDirectory(Log log, File workingDirectory) throws MojoExec
* @param toFile the {@link File} to which to copy into.
* @throws MojoExecutionException if an {@link IOException} occurs.
*/
public static void copyFile(Log log, File fromFile, File toFile) throws MojoExecutionException {
FileInputStream in;
FileOutputStream out;
public static void copyFile(Log log, File fromFile, File toFile) throws MojoExecutionException {
try {
in = new FileInputStream(fromFile);
out = new FileOutputStream(toFile);
byte[] buf = new byte[BUFFER_BYTE_SIZE];
int len;
while ((len = in.read(buf)) > 0) {
out.write(buf, 0, len);
}
in.close();
out.close();
FileUtils.copyFile(fromFile, toFile);
} catch (IOException e) {
log.error(e.getMessage());
throw new MojoExecutionException("Unable to copy file: " + e.getMessage(), e);

0 comments on commit 5082cd0

Please sign in to comment.