/** * Resolves the directory to store the FST models based on the configured * {@link IndexConfiguration#FST_FOLDER}. Also considering the name of the SolrServer and * SolrCore * @param core * @param fstFolderConfig * @return */ private File getFstDirectory(SolrCore core, String fstFolderConfig) { StrSubstitutor substitutor = new StrSubstitutor(new SolrCoreStrLookup( indexReference, core, bundleContext)); substitutor.setEnableSubstitutionInVariables(true); String folderStr = substitutor.replace(fstFolderConfig); if(folderStr.indexOf("${") > 0){ folderStr = substitutor.replace(folderStr); } //convert separators to the current OS folderStr = FilenameUtils.separatorsToSystem(folderStr); File fstDir = new File(folderStr); if(!fstDir.isDirectory()){ //create the FST directory try { FileUtils.forceMkdir(fstDir); } catch (IOException e) { throw new IllegalStateException("Unable to create Directory for" + "storing the FST files at location '"+fstDir+"'."); } } return fstDir; }