@Test public void cleanupIndexConfiguration() throws IOException { File tmpDir = Files.createTempDir(); NamedByteArrayResource firstResource = new NamedByteArrayResource("some resource content".getBytes(), "filename.txt"); IndexConfiguration indexConfiguration = createIndexConfiguration("indexName", "indexDirectory", firstResource); indexConfiguration.setPersistent(false); indexConfigurationCopier.copyIndexConfiguration(indexConfiguration, tmpDir.getAbsolutePath()); indexConfigurationCopier.cleanupIndexConfiguration(indexConfiguration, tmpDir.getAbsolutePath()); assertEmptyDirectory(tmpDir); FileUtils.deleteDirectory(tmpDir); }
public void cleanupIndexConfiguration(IndexConfiguration indexConfiguration, String configurationPath) { if (indexConfiguration.isPersistent()) { return; } log.info("Cleaning configuration files and data for index with name {}", indexConfiguration.getName()); File confHomeDir = new File(configurationPath); File indexDir = new File(confHomeDir, indexConfiguration.getInstanceDir()); FileUtils.deleteQuietly(indexDir); }
SolrIndexConfigurationCopier { public void cleanupIndexConfiguration(IndexConfiguration indexConfiguration, String configurationPath) { if (indexConfiguration.isPersistent()) { return; } log.info("Cleaning configuration files and data for index with name {}", indexConfiguration.getName()); File confHomeDir = new File(configurationPath); File indexDir = new File(confHomeDir, indexConfiguration.getInstanceDir()); FileUtils.deleteQuietly(indexDir); } }
SolrIndexConfigurationCopier { public void cleanupIndexConfiguration(IndexConfiguration indexConfiguration, String configurationPath) { if (indexConfiguration.isPersistent()) { return; } log.info("Cleaning configuration files and data for index with name {}", indexConfiguration.getName()); File confHomeDir = new File(configurationPath); File indexDir = new File(confHomeDir, indexConfiguration.getInstanceDir()); FileUtils.deleteQuietly(indexDir); }  }
SolrIndexConfigurationCopier { public void cleanupIndexConfiguration(IndexConfiguration indexConfiguration, String configurationPath) { if (indexConfiguration.isPersistent()) { return; } log.info("Cleaning configuration files and data for index with name {}", indexConfiguration.getName()); File confHomeDir = new File(configurationPath); File indexDir = new File(confHomeDir, indexConfiguration.getInstanceDir()); FileUtils.deleteQuietly(indexDir); }  void copyIndexConfiguration(IndexConfiguration indexConfiguration, String configurationPath); void cleanupIndexConfiguration(IndexConfiguration indexConfiguration, String configurationPath); }
SolrIndexConfigurationCopier { public void cleanupIndexConfiguration(IndexConfiguration indexConfiguration, String configurationPath) { if (indexConfiguration.isPersistent()) { return; } log.info("Cleaning configuration files and data for index with name {}", indexConfiguration.getName()); File confHomeDir = new File(configurationPath); File indexDir = new File(confHomeDir, indexConfiguration.getInstanceDir()); FileUtils.deleteQuietly(indexDir); }  void copyIndexConfiguration(IndexConfiguration indexConfiguration, String configurationPath); void cleanupIndexConfiguration(IndexConfiguration indexConfiguration, String configurationPath);  }