Hi,

I wrote a custom fieldtype that need to read a configuration file in the conf directory of the core and also get the absolute path of the conf directory

In solr 4 alpha, my code was something like :


import org.apache.solr.core.SolrResourceLoader;
...

public class MultilingualField extends TextField implements ResourceLoaderAware {
...

public void inform(ResourceLoader loader) {
    List<String> lines = loader.getLines("multiligual.xml");
    // do something with lines

    String configDir = ((SolrResourceLoader) loader).getConfigDir();
    // do something with configDir
...






In beta version, there was a big refactoring of analyzer factories and ressource loaders

now, inform method signature is

public void inform(org.apache.lucene.analysis.util.ResourceLoader loader) {

...


I still can read the configuration file with something like

FileInputStream fis = (FileInputStream) loader.openResource("multilingual.xml");

But, I can't get the conf directory absolute path anymore.


Any suggestion ?

Thank you.

Dominique

Reply via email to