You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by xu...@apache.org on 2010/01/11 08:38:29 UTC

svn commit: r897778 - /geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/util/FileUtils.java

Author: xuhaihong
Date: Mon Jan 11 07:38:29 2010
New Revision: 897778

URL: http://svn.apache.org/viewvc?rev=897778&view=rev
Log:
Minor fix for FileUtils

Modified:
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/util/FileUtils.java

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/util/FileUtils.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/util/FileUtils.java?rev=897778&r1=897777&r2=897778&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/util/FileUtils.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/util/FileUtils.java Mon Jan 11 07:38:29 2010
@@ -52,7 +52,7 @@
     }
 
     public static void copyFile(File source, File destination, int bufferSizeInBytes) throws IOException {
-        if (!source.exists() || source.isFile()) {
+        if (!source.exists() || source.isDirectory()) {
             throw new IllegalArgumentException("Source does not exist or it is not a file");
         }
         File destinationDir = destination.getParentFile();
@@ -64,7 +64,7 @@
         try {
             in = new FileInputStream(source);
             out = new FileOutputStream(destination);
-            IOUtils.copy(in, out);
+            IOUtils.copy(in, out, bufferSizeInBytes);
         } finally {
             IOUtils.close(in);
             IOUtils.close(out);