Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
2.4
-
None
-
None
Description
Consider the following:
File fooDir = new File("/temp/foo"); File fooFile = new File("/temp/foo.txt"); FileUtils.directoryContains(fooDir, fooFile); // returns true, should return false
fooFile is a sibling of fooDir. fooDir does not contain fooFile.
This is due to the way FilenameUtils.directoryContains is implemented in that this method uses a simple 'startsWith' comparison. A related bug is filed for the FilenameUtils method that I believe should be fixed as well.
Attachments
Issue Links
- duplicates
-
IO-423 FilenameUtils.directoryContains assumes separator at end of parent path
- Closed