Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-8572

LogExporter throws if a directory matches its file selector

    XMLWordPrintableJSON

Details

    Description

      LogExporter tries to read and export any directory entry whose name is accepted by its log file selector predicate. The predicate accepts any entry whose name, when converted to lower case, contains ".log". If one of those entries is directory, the predicate accepts it anyway. When LogExporter attempts to create a FileReader read it, the FileReader constructor throws FileNotFoundException.

      There is a stat file selector predicate that works similarly.

      LogExporter's log and stat file selector predicates should accept only files, and not directories. And perhaps the should accept only files whose names end in the appropriate extension, rather than containing the characters. The predicates are defined in LogExporter's findLogFiles() and findStatFiles() methods.

      I discovered this defect by running LogExporterIntegrationTest on macOS. Each test's preparation writes some to-be-exported files into a temporary directory that, on macOS, may contain numerous other files and directories. One of those directories (e.g. /var/folders/yz/6y59fxln38d7lf2jxng1zgg40000gn/T/com.apple.LoginUserService), which matches the LogExporter's predicate.

      These tests should also be changed to write their to-be-exported files to a directory that is known to be empty.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              demery Dale Emery
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: