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

Improve logging for FileDataSource (basePath, relative resources).

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.0
    • Fix Version/s: 4.1, 6.0
    • Component/s: None
    • Labels:
      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

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: