Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-4268

Rename ResourceAsStreamReasourceLoader to ClasspathResourceLoader, supply simple FilesystemResourceLoader

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.0-BETA, 6.0
    • modules/analysis
    • None
    • New, Patch Available

    Description

      We should rename the class and also fix some bugs:

      • Class/ClassLoader.getResourceAsStream() returns null when resource not found (which is a Java bug in my opinion) and does not throw IOException. SolrResourceLoader throws IOException, the Lucene "example" one should do the same. This prevents NPEs everywhere.

      Improvements:

      • Add no-arg CTOR that uses context class loader instead a given class. This is more what users want. Resource names must then include package name, of course.

      We should also provide a second implementation that allows resource names to be full filesystem paths. I think for loading the resources like custom word list, this is the most wanted implementation. Loading of classes would be delegated to ClassLoader (of course).

      I dont like ResourceLoader also supplying newInstance(), can we remove this for analysis?

      Attachments

        1. LUCENE-4268.patch
          33 kB
          Uwe Schindler
        2. LUCENE-4268.patch
          33 kB
          Uwe Schindler
        3. LUCENE-4268.patch
          28 kB
          Uwe Schindler
        4. LUCENE-4268.patch
          23 kB
          Uwe Schindler

        Activity

          People

            uschindler Uwe Schindler
            uschindler Uwe Schindler
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: