Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-4288

Improve logging for FileDataSource (basePath, relative resources).

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 4.0
    • 4.1, 6.0
    • None
    • None

    Description

      In fact, the logic is broken:

            if (!file.isAbsolute())
              file = new File(basePath + query);
      

      because basePath is null so 'null' is concatenated with the query string (path) resulting in an invalid path.

      It should be checked if basePath is null, if so default to "."? Then resolve relative location as:

      new File(basePathFile, query);
      

      I'd also say change the log so that the absolute path is also logged in the warning message, otherwise it's really hard to figure out what's going on.

      Attachments

        1. SOLR-4288.patch
          3 kB
          Dawid Weiss

        Activity

          People

            dweiss Dawid Weiss
            dweiss Dawid Weiss
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: