Skip to content

Commit 82d4f46

Browse files
author
Gary Gregory
committed
Update Javadoc and test to reflect implementation.
1 parent 7eabae5 commit 82d4f46

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,7 +1407,7 @@ public static void forceDeleteOnExit(final File file) throws IOException {
14071407
* If the directory cannot be created (or the file already exists but is not a directory)
14081408
* then an IOException is thrown.
14091409
*
1410-
* @param directory directory to create, must not be {@code null}.
1410+
* @param directory directory to create, may be {@code null}.
14111411
* @throws IOException if the directory was not created along with all its parent directories.
14121412
* @throws IOException if the given file object is not a directory.
14131413
* @throws SecurityException See {@link File#mkdirs()}.
@@ -2966,7 +2966,7 @@ public static long sizeOf(final File file) {
29662966
requireExists(file, "file");
29672967
try {
29682968
return PathUtils.sizeOf(file.toPath());
2969-
} catch (IOException e) {
2969+
} catch (final IOException e) {
29702970
// TODO Update method signature
29712971
throw new UncheckedIOException(e);
29722972
}
@@ -2995,7 +2995,7 @@ public static BigInteger sizeOfAsBigInteger(final File file) {
29952995
requireExists(file, "file");
29962996
try {
29972997
return PathUtils.sizeOfAsBigInteger(file.toPath());
2998-
} catch (IOException e) {
2998+
} catch (final IOException e) {
29992999
// TODO Update method signature
30003000
throw new UncheckedIOException(e);
30013001
}
@@ -3019,7 +3019,7 @@ public static long sizeOfDirectory(final File directory) {
30193019
requireDirectoryExists(directory, "directory");
30203020
try {
30213021
return PathUtils.sizeOfDirectory(directory.toPath());
3022-
} catch (IOException e) {
3022+
} catch (final IOException e) {
30233023
// TODO Update method signature
30243024
throw new UncheckedIOException(e);
30253025
}
@@ -3038,7 +3038,7 @@ public static BigInteger sizeOfDirectoryAsBigInteger(final File directory) {
30383038
requireDirectoryExists(directory, "directory");
30393039
try {
30403040
return PathUtils.sizeOfDirectoryAsBigInteger(directory.toPath());
3041-
} catch (IOException e) {
3041+
} catch (final IOException e) {
30423042
// TODO Update method signature
30433043
throw new UncheckedIOException(e);
30443044
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,6 +1516,9 @@ public void testForceMkdir() throws Exception {
15161516
// Tests with non-existent directory
15171517
FileUtils.forceMkdir(testFile);
15181518
assertTrue(testFile.exists(), "Directory was not created.");
1519+
1520+
// noop
1521+
FileUtils.forceMkdir(null);
15191522
}
15201523

15211524
@Test

0 commit comments

Comments
 (0)