[
https://issues.apache.org/jira/browse/IO-423?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14248829#comment-14248829
]
Ray Navarette commented on IO-423:
----------------------------------
Unfortunately though this same issue surfaces when calling
FileUtils.directoryContains(File parent, File child).
Also, I'm not certain what the above comment implies. The docs do in fact
mention the paths needing to be normalized, but even using the
FilenameUtils.normalize(String path) method on the initial example here would
show the same wrong behavior.
> FilenameUtils.directoryContains assumes separator at end of parent path
> -----------------------------------------------------------------------
>
> Key: IO-423
> URL: https://issues.apache.org/jira/browse/IO-423
> Project: Commons IO
> Issue Type: Bug
> Components: Utilities
> Affects Versions: 2.4
> Reporter: Vinithra Varadharajan
>
> FilenameUtils.directoryContains("/abc", "/abcd") returns true, while
> FilenameUtils.directoryContains("/abc/", "/abcd") returns false.
> The implementation does a simple checkStartsWith() without taking the
> separator into consideration.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)