Skip to content

Commit c9c9cc0

Browse files
committed
[IO-804] FileUtils.forceMkdirParent api doc is likely incorrect
1 parent 40965f1 commit c9c9cc0

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/changes/changes.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ The <action> type attribute can be add,update,fix,remove.
6565
<action dev="ggregory" type="fix" issue="IO-799" due-to="Jeroen van der Vegt, Gary Gregory">
6666
ReaderInputStream.read() throws an exception instead of returning -1 when called again after returning -1.
6767
</action>
68+
<action dev="ggregory" type="fix" issue="IO-804" due-to="Elliotte Rusty Harold, Gary Gregory">
69+
FileUtils.forceMkdirParent() Javadoc is likely incorrect.
70+
</action>
6871
<!-- UPDATE -->
6972
</release>
7073
<release version="2.13.0" date="2023-06-03" description="Java 8 required.">

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,16 +1381,15 @@ public static void forceMkdir(final File directory) throws IOException {
13811381
}
13821382

13831383
/**
1384-
* Calls {@link File#mkdirs()} and throws an {@link IOException} on failure.
1384+
* Creates all directories for a File object, including any necessary but nonexistent parent directories. If the parent directory already exists or is null,
1385+
* nothing happens.
13851386
* <p>
1386-
* Creates all directories for a File object, including any necessary but nonexistent parent directories. If the {@code directory} already exists or is
1387-
* null, nothing happens.
1387+
* Calls {@link File#mkdirs()} for the parent of @{code file}.
13881388
* </p>
13891389
*
13901390
* @param file file with parents to create, must not be {@code null}.
13911391
* @throws NullPointerException if the file is {@code null}.
13921392
* @throws IOException if the directory was not created along with all its parent directories.
1393-
* @throws IOException if the given file object is not a directory.
13941393
* @throws SecurityException See {@link File#mkdirs()}.
13951394
* @see File#mkdirs()
13961395
* @since 2.5

0 commit comments

Comments
 (0)