Uploaded image for project: 'Commons IO'
  1. Commons IO
  2. IO-727

FilenameUtils.directoryContains() and FileUtils.directoryContains() return wrong result when parent and child have the same path prefix

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.12.0
    • Utilities
    • None

    Description

      FilenameUtils.directoryContains() and FileUtils.directoryContains() will return `true` with the following input.

      canonicalParent: /path/foo
      canonicalChild:  /path/foobar
      

      There were several issues on this but the problem still remains.
      IO-423 didn't do anything.
      IO-466 test case added in 676c03 just happened to passed because the input file didn't exist.
      Github PR: https://github.com/apache/commons-io/pull/217

      Attachments

        Activity

          People

            Unassigned Unassigned
            trungPa Trung Pham
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h 10m
                1h 10m