Commons IO
  1. Commons IO
  2. IO-187

FileSystemUtils.freeSpaceKb doesn't work with relative paths on Linux

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2, 1.3, 1.3.1, 1.3.2, 1.4
    • Fix Version/s: 2.0
    • Component/s: Utilities
    • Labels:
      None
    • Environment:

      Linux

      Description

      Calling FileSystemUtils.freeSpaceKb with ".", "./", "../", "../foo" etc. will result in an empty string being passed to df.
      freeSpaceKb calls FileNameUtils.normalize on the path which destroys relative paths.

      I don't see any need to normalize the path so the fix is simply to remove that call.

        Activity

        Hide
        Sebb added a comment -

        Agreed - the path normalisation is unnecessary on Unix.
        [It's probably unnecessary on Windows as well]

        URL: http://svn.apache.org/viewvc?rev=919687&view=rev
        Log:
        IO-187 FileSystemUtils.freeSpaceKb doesn't work with relative paths on Linux

        Show
        Sebb added a comment - Agreed - the path normalisation is unnecessary on Unix. [It's probably unnecessary on Windows as well] URL: http://svn.apache.org/viewvc?rev=919687&view=rev Log: IO-187 FileSystemUtils.freeSpaceKb doesn't work with relative paths on Linux

          People

          • Assignee:
            Unassigned
            Reporter:
            Cormac Blackwell
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development