Description
In some cases IllegalArgumentException is thrown when the given File object is a normal file and not a directory, the JavaDoc should reflect this.
Patch as follows:
-
-
- Eclipse Workspace Patch 1.0
#P commons-io
Index: src/main/java/org/apache/commons/io/FileUtils.java
===================================================================
- src/main/java/org/apache/commons/io/FileUtils.java (revision 1585896)
+++ src/main/java/org/apache/commons/io/FileUtils.java (working copy)
@@ -1557,6 +1557,7 @@
*
- Eclipse Workspace Patch 1.0
-
- @param directory directory to delete
- @throws IOException in case deletion is unsuccessful
+ * @throws IllegalArgumentException if the given directory does not exists or is a file
*/
public static void deleteDirectory(final File directory) throws IOException {
if (!directory.exists()) {
@@ -1628,6 +1629,7 @@ - @return true is the candidate leaf is under by the specified composite. False otherwise.
- @throws IOException
- if an IO error occurs while checking the files.
+ * @throws IllegalArgumentException if the given directory is passed null or is not a directory - @since 2.2
- @see FilenameUtils#directoryContains(String, String)
*/
@@ -1662,6 +1664,7 @@
* - @param directory directory to clean
- @throws IOException in case cleaning is unsuccessful
+ * @throws IllegalArgumentException if the given directory does not exists or is a file
*/
public static void cleanDirectory(final File directory) throws IOException {
if (!directory.exists()) {