You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ni...@apache.org on 2009/02/15 20:23:01 UTC

svn commit: r744725 - in /commons/proper/io/trunk/src: java/org/apache/commons/io/FileUtils.java test/org/apache/commons/io/FileUtilsTestCase.java

Author: niallp
Date: Sun Feb 15 19:23:00 2009
New Revision: 744725

URL: http://svn.apache.org/viewvc?rev=744725&view=rev
Log:
IO-157 revert as this breaks binary compatibility with previous releases

Modified:
    commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java
    commons/proper/io/trunk/src/test/org/apache/commons/io/FileUtilsTestCase.java

Modified: commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java?rev=744725&r1=744724&r2=744725&view=diff
==============================================================================
--- commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java (original)
+++ commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java Sun Feb 15 19:23:00 2009
@@ -554,15 +554,14 @@
      *
      * @param srcFile  an existing file to copy, must not be <code>null</code>
      * @param destDir  the directory to place the copy in, must not be <code>null</code>
-     * @return the new file
      *
      * @throws NullPointerException if source or destination is null
      * @throws IOException if source or destination is invalid
      * @throws IOException if an IO error occurs during copying
      * @see #copyFile(File, File, boolean)
      */
-    public static File copyFileToDirectory(File srcFile, File destDir) throws IOException {
-        return copyFileToDirectory(srcFile, destDir, true);
+    public static void copyFileToDirectory(File srcFile, File destDir) throws IOException {
+        copyFileToDirectory(srcFile, destDir, true);
     }
 
     /**
@@ -577,7 +576,6 @@
      * @param destDir  the directory to place the copy in, must not be <code>null</code>
      * @param preserveFileDate  true if the file date of the copy
      *  should be the same as the original
-     * @return the new file
      *
      * @throws NullPointerException if source or destination is <code>null</code>
      * @throws IOException if source or destination is invalid
@@ -585,7 +583,7 @@
      * @see #copyFile(File, File, boolean)
      * @since Commons IO 1.3
      */
-    public static File copyFileToDirectory(File srcFile, File destDir, boolean preserveFileDate) throws IOException {
+    public static void copyFileToDirectory(File srcFile, File destDir, boolean preserveFileDate) throws IOException {
         if (destDir == null) {
             throw new NullPointerException("Destination must not be null");
         }
@@ -594,7 +592,6 @@
         }
         File destFile = new File(destDir, srcFile.getName());
         copyFile(srcFile, destFile, preserveFileDate);
-        return destFile;
     }
 
     /**

Modified: commons/proper/io/trunk/src/test/org/apache/commons/io/FileUtilsTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/org/apache/commons/io/FileUtilsTestCase.java?rev=744725&r1=744724&r2=744725&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/org/apache/commons/io/FileUtilsTestCase.java (original)
+++ commons/proper/io/trunk/src/test/org/apache/commons/io/FileUtilsTestCase.java Sun Feb 15 19:23:00 2009
@@ -898,8 +898,7 @@
         //This is to slow things down so we can catch if 
         //the lastModified date is not ok
         
-        File result = FileUtils.copyFileToDirectory(testFile1, directory);
-        assertEquals("Check File", destination, result);
+        FileUtils.copyFileToDirectory(testFile1, directory);
         assertTrue("Check Exist", destination.exists());
         assertTrue("Check Full copy", destination.length() == testFile1Size);
         /* disabled: Thread.sleep doesn't work reliantly for this case