You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Dawid Weiss (JIRA)" <ji...@apache.org> on 2013/01/09 15:14:12 UTC

[jira] [Created] (SOLR-4288) FileDataSource with an empty basePath and a relative resource is broken.

Dawid Weiss created SOLR-4288:
---------------------------------

             Summary: FileDataSource with an empty basePath and a relative resource is broken.
                 Key: SOLR-4288
                 URL: https://issues.apache.org/jira/browse/SOLR-4288
             Project: Solr
          Issue Type: Bug
    Affects Versions: 4.0
            Reporter: Dawid Weiss
            Priority: Minor
             Fix For: 4.1, 5.0


In fact, the logic is broken:
{code}
      if (!file.isAbsolute())
        file = new File(basePath + query);
{code}
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:

{code}
new File(basePathFile, query);
{code}

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.




--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org