@Test public void copyIndexConfiguration() throws IOException { File tmpDir = Files.createTempDir(); NamedByteArrayResource firstResource = new NamedByteArrayResource("some resource content".getBytes(), "filename.txt"); NamedByteArrayResource secondResource = new NamedByteArrayResource("some other resource content".getBytes(), "secondFilename.txt"); IndexConfiguration indexConfiguration = createIndexConfiguration("indexName", "indexDirectory", firstResource, secondResource); indexConfigurationCopier.copyIndexConfiguration(indexConfiguration, tmpDir.getAbsolutePath()); assertIndexConfStructure(tmpDir, "indexDirectory"); assertIndexConfFile(tmpDir, "indexDirectory", "filename.txt", "some resource content"); assertIndexConfFile(tmpDir, "indexDirectory", "secondFilename.txt", "some other resource content"); FileUtils.deleteDirectory(tmpDir); }
public void copyIndexConfiguration(IndexConfiguration indexConfiguration, String configurationPath) { log.info("Copying configuration files for index with name {}", indexConfiguration.getName()); File confHomeDir = new File(configurationPath); File indexDir = new File(confHomeDir, indexConfiguration.getInstanceDir()); createDirectory(indexDir); if (indexConfiguration.isCreateIndexPropertyFile()) { createIndexPropertyFile(indexDir, indexConfiguration); } File indexConfDir = new File(indexDir, SolrConstants.INDEX_CONFIG_DIRECTORY_NAME); createDirectory(indexConfDir); for (Resource configurationFile : indexConfiguration.getConfigurationFiles()) { File targetFile = new File(indexConfDir, configurationFile.getFilename()); SearchConfigurationFilesUtils.copyResource(configurationFile, targetFile); } }
SolrIndexConfigurationCopier { public void copyIndexConfiguration(IndexConfiguration indexConfiguration, String configurationPath) { log.info("Copying configuration files for index with name {}", indexConfiguration.getName()); File confHomeDir = new File(configurationPath); File indexDir = new File(confHomeDir, indexConfiguration.getInstanceDir()); createDirectory(indexDir); if (indexConfiguration.isCreateIndexPropertyFile()) { createIndexPropertyFile(indexDir, indexConfiguration); } File indexConfDir = new File(indexDir, SolrConstants.INDEX_CONFIG_DIRECTORY_NAME); createDirectory(indexConfDir); for (Resource configurationFile : indexConfiguration.getConfigurationFiles()) { File targetFile = new File(indexConfDir, configurationFile.getFilename()); SearchConfigurationFilesUtils.copyResource(configurationFile, targetFile); } } }
SolrIndexConfigurationCopier { public void copyIndexConfiguration(IndexConfiguration indexConfiguration, String configurationPath) { log.info("Copying configuration files for index with name {}", indexConfiguration.getName()); File confHomeDir = new File(configurationPath); File indexDir = new File(confHomeDir, indexConfiguration.getInstanceDir()); createDirectory(indexDir); if (indexConfiguration.isCreateIndexPropertyFile()) { createIndexPropertyFile(indexDir, indexConfiguration); } File indexConfDir = new File(indexDir, SolrConstants.INDEX_CONFIG_DIRECTORY_NAME); createDirectory(indexConfDir); for (Resource configurationFile : indexConfiguration.getConfigurationFiles()) { File targetFile = new File(indexConfDir, configurationFile.getFilename()); SearchConfigurationFilesUtils.copyResource(configurationFile, targetFile); } }  }
SolrIndexConfigurationCopier { public void copyIndexConfiguration(IndexConfiguration indexConfiguration, String configurationPath) { log.info("Copying configuration files for index with name {}", indexConfiguration.getName()); File confHomeDir = new File(configurationPath); File indexDir = new File(confHomeDir, indexConfiguration.getInstanceDir()); createDirectory(indexDir); if (indexConfiguration.isCreateIndexPropertyFile()) { createIndexPropertyFile(indexDir, indexConfiguration); } File indexConfDir = new File(indexDir, SolrConstants.INDEX_CONFIG_DIRECTORY_NAME); createDirectory(indexConfDir); for (Resource configurationFile : indexConfiguration.getConfigurationFiles()) { File targetFile = new File(indexConfDir, configurationFile.getFilename()); SearchConfigurationFilesUtils.copyResource(configurationFile, targetFile); } }  void copyIndexConfiguration(IndexConfiguration indexConfiguration, String configurationPath); void cleanupIndexConfiguration(IndexConfiguration indexConfiguration, String configurationPath); }
SolrIndexConfigurationCopier { public void copyIndexConfiguration(IndexConfiguration indexConfiguration, String configurationPath) { log.info("Copying configuration files for index with name {}", indexConfiguration.getName()); File confHomeDir = new File(configurationPath); File indexDir = new File(confHomeDir, indexConfiguration.getInstanceDir()); createDirectory(indexDir); if (indexConfiguration.isCreateIndexPropertyFile()) { createIndexPropertyFile(indexDir, indexConfiguration); } File indexConfDir = new File(indexDir, SolrConstants.INDEX_CONFIG_DIRECTORY_NAME); createDirectory(indexConfDir); for (Resource configurationFile : indexConfiguration.getConfigurationFiles()) { File targetFile = new File(indexConfDir, configurationFile.getFilename()); SearchConfigurationFilesUtils.copyResource(configurationFile, targetFile); } }  void copyIndexConfiguration(IndexConfiguration indexConfiguration, String configurationPath); void cleanupIndexConfiguration(IndexConfiguration indexConfiguration, String configurationPath);  }