cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ko...@apache.org
Subject git commit: updated refs/heads/master to cff5ea0
Date Thu, 07 Nov 2013 21:37:34 GMT
Updated Branches:
  refs/heads/master 7ba55723b -> cff5ea094


FileUtil: use commons-io FileUtils

- removed the method body ot FileUtil.copyFile and replaced with FleUtils.copyFile

Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/cff5ea09
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/cff5ea09
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/cff5ea09

Branch: refs/heads/master
Commit: cff5ea0949e65836b7961004aff959aacd79ea82
Parents: 7ba5572
Author: Laszlo Hornyak <laszlo.hornyak@gmail.com>
Authored: Thu Nov 7 21:44:11 2013 +0100
Committer: Laszlo Hornyak <laszlo.hornyak@gmail.com>
Committed: Thu Nov 7 22:36:02 2013 +0100

----------------------------------------------------------------------
 utils/src/com/cloud/utils/FileUtil.java | 22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cff5ea09/utils/src/com/cloud/utils/FileUtil.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/FileUtil.java b/utils/src/com/cloud/utils/FileUtil.java
index a6f0c91..96ad3af 100644
--- a/utils/src/com/cloud/utils/FileUtil.java
+++ b/utils/src/com/cloud/utils/FileUtil.java
@@ -17,28 +17,14 @@
 package com.cloud.utils;
 
 import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
 import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
 
-public class FileUtil {
+import org.apache.commons.io.FileUtils;
 
-    public static void copyfile(File f1, File f2) throws IOException {
-        InputStream in = new FileInputStream(f1);
-        OutputStream out = new FileOutputStream(f2);
+public class FileUtil {
 
-        try {
-            byte[] buf = new byte[1024];
-            int len;
-            while ((len = in.read(buf)) > 0) {
-                out.write(buf, 0, len);
-            }
-        } finally {
-            in.close();
-            out.close();
-        }
+    public static void copyfile(File source, File destination) throws IOException {
+        FileUtils.copyFile(source, destination);
     }
 }
 


Mime
View raw message