This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-io.git
The following commit(s) were added to refs/heads/master by this push:
new 31cc89e [IO-748] FileUtils.moveToDirectory() exception documentation
and exception message error.
31cc89e is described below
commit 31cc89e03b20ebb066e581f0491b87e80259805f
Author: Gary Gregory <[email protected]>
AuthorDate: Mon Sep 13 09:46:18 2021 -0700
[IO-748] FileUtils.moveToDirectory() exception documentation and
exception message error.
---
src/changes/changes.xml | 2 +-
src/main/java/org/apache/commons/io/FileUtils.java | 18 +++++++++++-------
2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 7453e42..2f285a1 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -65,7 +65,7 @@ The <action> type attribute can be add,update,fix,remove.
<action issue="IO-746" dev="ggregory" type="add" due-to="Davide
Angelocola">
Drop unnecessary casts and conversions #267.
</action>
- <action issue="IO-748" dev="ggregory" type="fix" due-to="Dirk Heinrichs,
Gary Gregory">
+ <action issue="IO-748" dev="ggregory" type="fix" due-to="Dirk Heinrichs,
Gary Gregory, Elango Ravi">
FileUtils.moveToDirectory() exception documentation and exception
message error.
</action>
<action dev="ggregory" type="fix" due-to="Gary Gregory">
diff --git a/src/main/java/org/apache/commons/io/FileUtils.java
b/src/main/java/org/apache/commons/io/FileUtils.java
index 932cf6f..e0a2b58 100644
--- a/src/main/java/org/apache/commons/io/FileUtils.java
+++ b/src/main/java/org/apache/commons/io/FileUtils.java
@@ -2269,7 +2269,7 @@ public class FileUtils {
/**
* Moves a directory to another directory.
*
- * @param src the file to be moved.
+ * @param source the file to be moved.
* @param destDir the destination file.
* @param createDestDir If {@code true} create the destination directory,
otherwise if {@code false} throw an
* IOException.
@@ -2279,9 +2279,9 @@ public class FileUtils {
* @throws IOException if an error occurs or setting the last-modified
time didn't succeeded.
* @since 1.4
*/
- public static void moveDirectoryToDirectory(final File src, final File
destDir, final boolean createDestDir)
+ public static void moveDirectoryToDirectory(final File source, final File
destDir, final boolean createDestDir)
throws IOException {
- validateMoveParameters(src, destDir);
+ validateMoveParameters(source, destDir);
if (!destDir.isDirectory()) {
if (destDir.exists()) {
throw new IOException("Destination '" + destDir + "' is not a
directory");
@@ -2292,7 +2292,7 @@ public class FileUtils {
}
mkdirs(destDir);
}
- moveDirectory(src, new File(destDir, src.getName()));
+ moveDirectory(source, new File(destDir, source.getName()));
}
/**
@@ -2308,6 +2308,7 @@ public class FileUtils {
* @param destFile the destination file.
* @throws NullPointerException if any of the given {@code File}s are
{@code null}.
* @throws FileExistsException if the destination file exists.
+ * @throws FileNotFoundException if the source file does not exist.
* @throws IOException if source or destination is invalid.
* @throws IOException if an error occurs.
* @since 1.4
@@ -2327,6 +2328,7 @@ public class FileUtils {
* @param copyOptions Copy options.
* @throws NullPointerException if any of the given {@code File}s are
{@code null}.
* @throws FileExistsException if the destination file exists.
+ * @throws FileNotFoundException if the source file does not exist.
* @throws IOException if source or destination is invalid.
* @throws IOException if an error occurs or setting the last-modified
time didn't succeeded.
* @since 2.9.0
@@ -2356,6 +2358,7 @@ public class FileUtils {
* IOException.
* @throws NullPointerException if any of the given {@code File}s are
{@code null}.
* @throws FileExistsException if the destination file exists.
+ * @throws FileNotFoundException if the source file does not exist.
* @throws IOException if source or destination is invalid.
* @throws IOException if an error occurs or setting the last-modified
time didn't succeeded.
* @since 1.4
@@ -2383,6 +2386,7 @@ public class FileUtils {
* IOException.
* @throws NullPointerException if any of the given {@code File}s are
{@code null}.
* @throws FileExistsException if the directory or file exists in the
destination directory.
+ * @throws FileNotFoundException if the source file does not exist.
* @throws IOException if source or destination is invalid.
* @throws IOException if an error occurs or setting the last-modified
time didn't succeeded.
* @since 1.4
@@ -3160,9 +3164,9 @@ public class FileUtils {
* <li>Throws {@link FileNotFoundException} if {@code source} does not
exist</li>
* </ul>
*
- * @param source the file or directory to be moved
- * @param destination the destination file or directory
- * @throws FileNotFoundException if {@code source} file does not exist
+ * @param source the file or directory to be moved.
+ * @param destination the destination file or directory.
+ * @throws FileNotFoundException if the source file does not exist.
*/
private static void validateMoveParameters(final File source, final File
destination) throws FileNotFoundException {
Objects.requireNonNull(source, "source");