public String getDataDir() { String dataDir = this.dataDir; if (dataDir == null) dataDir = getDefaultDataDir(); if (new File(dataDir).isAbsolute()) { return dataDir; } else { if (new File(instanceDir).isAbsolute()) { return SolrResourceLoader.normalizeDir(SolrResourceLoader.normalizeDir(instanceDir) + dataDir); } else { return SolrResourceLoader.normalizeDir(coreContainer.getSolrHome() + SolrResourceLoader.normalizeDir(instanceDir) + dataDir); } } }
public CoreDescriptor(CoreContainer coreContainer, String name, String instanceDir) { this.coreContainer = coreContainer; this.name = name; if (name == null) { throw new RuntimeException("Core needs a name"); } if (instanceDir == null) { throw new NullPointerException("Missing required \'instanceDir\'"); } instanceDir = SolrResourceLoader.normalizeDir(instanceDir); this.instanceDir = instanceDir; this.configName = getDefaultConfigName(); this.schemaName = getDefaultSchemaName(); }
log.info(project + " home defaulted to '" + home + "' (could not find system property or JNDI)"); return normalizeDir( home );
/** * <p> * This loader will delegate to the context classloader when possible, * otherwise it will attempt to resolve resources using any jar files * found in the "lib/" directory in the specified instance directory. * If the instance directory is not specified (=null), SolrResourceLoader#locateInstanceDir will provide one. * <p> */ public SolrResourceLoader( String instanceDir, ClassLoader parent, Properties coreProperties ) { if( instanceDir == null ) { this.instanceDir = SolrResourceLoader.locateSolrHome(); } else{ this.instanceDir = normalizeDir(instanceDir); } log.info("Solr home set to '" + this.instanceDir + "'"); this.classLoader = createClassLoader(null, parent); addToClassLoader("./lib/", null); this.coreProperties = coreProperties; }
dataDir = SolrResourceLoader.normalizeDir(dataDir);