Repository: commons-release-plugin Updated Branches: refs/heads/master 1feed287d -> 5082cd05f
Use Plexus FileUtils instead of custom code. Project: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/commit/5082cd05 Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/5082cd05 Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/5082cd05 Branch: refs/heads/master Commit: 5082cd05fef5baa24e905cb2d701f8c0939610d7 Parents: 1feed28 Author: Gary Gregory <garydgreg...@gmail.com> Authored: Thu May 17 08:47:45 2018 -0600 Committer: Gary Gregory <garydgreg...@gmail.com> Committed: Thu May 17 08:47:45 2018 -0600 ---------------------------------------------------------------------- .../commons/release/plugin/SharedFunctions.java | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/5082cd05/src/main/java/org/apache/commons/release/plugin/SharedFunctions.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/release/plugin/SharedFunctions.java b/src/main/java/org/apache/commons/release/plugin/SharedFunctions.java index 7d8e476..547e988 100644 --- a/src/main/java/org/apache/commons/release/plugin/SharedFunctions.java +++ b/src/main/java/org/apache/commons/release/plugin/SharedFunctions.java @@ -78,19 +78,9 @@ public final class SharedFunctions { * @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);