On Windows, if you give a directory name with space-chars at the end
(like "C:\foo\ ") to java.io.File then
isDirectory() will return true, but the list() method
will return null even if there are files in the directory:
This breaks the contract between isDirectory()
and list(), which is if isDirectory() returns true then
list() must not return null. This situation arises from
bug 4849568.
(like "C:\foo\ ") to java.io.File then
isDirectory() will return true, but the list() method
will return null even if there are files in the directory:
This breaks the contract between isDirectory()
and list(), which is if isDirectory() returns true then
list() must not return null. This situation arises from
bug 4849568.
- relates to
-
JDK-8156657 Directory and file names ending with spaces are not supported by java.io.File
-
- Closed
-
-
JDK-8190546 File.toPath() reject directory names with trailing space
-
- Closed
-