Drives do not have file names
Katsute opened this issue · 1 comments
Prerequisites
If all checks are not passed then the issue will be closed
- I have checked that no other similar issue already exists
Operating System: Operating system name and version
Windows 10
Release Version: Release version or branch where the issue occurred
03.05.04
Issue
Explain your issue. Add any screenshots here
When adding a directory that is a root there is a null file name.
Expected Behavior
Explain what was supposed to happen
Root directory should return directory name.
Steps To Reproduce
Explain how and/or when the error occurred
These methods may return null on #getName() when a drive is supplied.
File#getParentFile can be used to detect roots.
If it is a root directory then it returns null because there is no parent.
FIle#getPath() can then be used as the name instead since only the directory should be part of the path.