@Test public void testDeleteKeyStoreFiles() throws Exception { File dir = new File(keystoresDir, "ssl"); assertThat(dir.mkdirs(), is(true)); assertThat(new File(dir, "trusted.ks").createNewFile(), is(true)); assertThat(new File(dir, "private.ks").createNewFile(), is(true)); service.deleteKeyStoreFiles(); assertThat(dir.exists(), is(false)); }
public void deleteKeyStoreFiles() { log.debug("Deleting legacy trust store from {}", keyStoreBasedir); try { for (String filename : Arrays.asList(TRUSTED_KEYS_FILENAME, PRIVATE_KEYS_FILENAME)) { Files.deleteIfExists(keyStoreBasedir.resolve(filename)); } Files.deleteIfExists(keyStoreBasedir); } catch (IOException e) { log.warn("Could not delete obsolete trust store from {}. Error: {}", keyStoreBasedir, e.toString()); } }
LegacyKeyStoreUpgradeService extends ComponentSupport { public void deleteKeyStoreFiles() { log.debug("Deleting legacy trust store from {}", keyStoreBasedir); try { for (String filename : Arrays.asList(TRUSTED_KEYS_FILENAME, PRIVATE_KEYS_FILENAME)) { Files.deleteIfExists(keyStoreBasedir.resolve(filename)); } Files.deleteIfExists(keyStoreBasedir); } catch (IOException e) { log.warn("Could not delete obsolete trust store from {}. Error: {}", keyStoreBasedir, e.toString()); } } }
LegacyKeyStoreUpgradeService extends ComponentSupport { public void deleteKeyStoreFiles() { log.debug("Deleting legacy trust store from {}", keyStoreBasedir); try { for (String filename : Arrays.asList(TRUSTED_KEYS_FILENAME, PRIVATE_KEYS_FILENAME)) { Files.deleteIfExists(keyStoreBasedir.resolve(filename)); } Files.deleteIfExists(keyStoreBasedir); } catch (IOException e) { log.warn("Could not delete obsolete trust store from {}. Error: {}", keyStoreBasedir, e.toString()); } } @Inject  LegacyKeyStoreUpgradeService(@Named(DatabaseInstanceNames.CONFIG) final Provider<DatabaseInstance> databaseInstance,
                                      final ApplicationDirectories appDirectories); }
LegacyKeyStoreUpgradeService extends ComponentSupport { public void deleteKeyStoreFiles() { log.debug("Deleting legacy trust store from {}", keyStoreBasedir); try { for (String filename : Arrays.asList(TRUSTED_KEYS_FILENAME, PRIVATE_KEYS_FILENAME)) { Files.deleteIfExists(keyStoreBasedir.resolve(filename)); } Files.deleteIfExists(keyStoreBasedir); } catch (IOException e) { log.warn("Could not delete obsolete trust store from {}. Error: {}", keyStoreBasedir, e.toString()); } } @Inject  LegacyKeyStoreUpgradeService(@Named(DatabaseInstanceNames.CONFIG) final Provider<DatabaseInstance> databaseInstance,
                                      final ApplicationDirectories appDirectories); void upgradeSchema(); void importKeyStoreFiles(); void deleteKeyStoreFiles(); }
LegacyKeyStoreUpgradeService extends ComponentSupport { public void deleteKeyStoreFiles() { log.debug("Deleting legacy trust store from {}", keyStoreBasedir); try { for (String filename : Arrays.asList(TRUSTED_KEYS_FILENAME, PRIVATE_KEYS_FILENAME)) { Files.deleteIfExists(keyStoreBasedir.resolve(filename)); } Files.deleteIfExists(keyStoreBasedir); } catch (IOException e) { log.warn("Could not delete obsolete trust store from {}. Error: {}", keyStoreBasedir, e.toString()); } } @Inject  LegacyKeyStoreUpgradeService(@Named(DatabaseInstanceNames.CONFIG) final Provider<DatabaseInstance> databaseInstance,
                                      final ApplicationDirectories appDirectories); void upgradeSchema(); void importKeyStoreFiles(); void deleteKeyStoreFiles();  }