Skip to content

Commit 151b816

Browse files
author
Niall Pemberton
committed
IO-157 revert as this breaks binary compatibility with previous releases
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/io/trunk@744725 13f79535-47bb-0310-9956-ffa450edef68
1 parent 80e9b2c commit 151b816

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

src/java/org/apache/commons/io/FileUtils.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -554,15 +554,14 @@ public static URL[] toURLs(File[] files) throws IOException {
554554
*
555555
* @param srcFile an existing file to copy, must not be <code>null</code>
556556
* @param destDir the directory to place the copy in, must not be <code>null</code>
557-
* @return the new file
558557
*
559558
* @throws NullPointerException if source or destination is null
560559
* @throws IOException if source or destination is invalid
561560
* @throws IOException if an IO error occurs during copying
562561
* @see #copyFile(File, File, boolean)
563562
*/
564-
public static File copyFileToDirectory(File srcFile, File destDir) throws IOException {
565-
return copyFileToDirectory(srcFile, destDir, true);
563+
public static void copyFileToDirectory(File srcFile, File destDir) throws IOException {
564+
copyFileToDirectory(srcFile, destDir, true);
566565
}
567566

568567
/**
@@ -577,15 +576,14 @@ public static File copyFileToDirectory(File srcFile, File destDir) throws IOExce
577576
* @param destDir the directory to place the copy in, must not be <code>null</code>
578577
* @param preserveFileDate true if the file date of the copy
579578
* should be the same as the original
580-
* @return the new file
581579
*
582580
* @throws NullPointerException if source or destination is <code>null</code>
583581
* @throws IOException if source or destination is invalid
584582
* @throws IOException if an IO error occurs during copying
585583
* @see #copyFile(File, File, boolean)
586584
* @since Commons IO 1.3
587585
*/
588-
public static File copyFileToDirectory(File srcFile, File destDir, boolean preserveFileDate) throws IOException {
586+
public static void copyFileToDirectory(File srcFile, File destDir, boolean preserveFileDate) throws IOException {
589587
if (destDir == null) {
590588
throw new NullPointerException("Destination must not be null");
591589
}
@@ -594,7 +592,6 @@ public static File copyFileToDirectory(File srcFile, File destDir, boolean prese
594592
}
595593
File destFile = new File(destDir, srcFile.getName());
596594
copyFile(srcFile, destFile, preserveFileDate);
597-
return destFile;
598595
}
599596

600597
/**

src/test/org/apache/commons/io/FileUtilsTestCase.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -898,8 +898,7 @@ public void testCopyFile1ToDir() throws Exception {
898898
//This is to slow things down so we can catch if
899899
//the lastModified date is not ok
900900

901-
File result = FileUtils.copyFileToDirectory(testFile1, directory);
902-
assertEquals("Check File", destination, result);
901+
FileUtils.copyFileToDirectory(testFile1, directory);
903902
assertTrue("Check Exist", destination.exists());
904903
assertTrue("Check Full copy", destination.length() == testFile1Size);
905904
/* disabled: Thread.sleep doesn't work reliantly for this case

0 commit comments

Comments
 (0)