DefaultPluginRepository extends BasePluginRepository { @Override public boolean deletePluginPath(Path pluginPath) { FileUtils.optimisticDelete(FileUtils.findWithEnding(pluginPath, ".zip", ".ZIP", ".Zip")); return super.deletePluginPath(pluginPath); } DefaultPluginRepository(Path pluginsRoot); @Override List<Path> getPluginPaths(); @Override boolean deletePluginPath(Path pluginPath);  }
@Test public void testDeletePluginPath() { PluginRepository repository = new DefaultPluginRepository(pluginsPath); assertTrue(Files.exists(pluginsPath.resolve("plugin-1.zip"))); assertTrue(repository.deletePluginPath(pluginsPath.resolve("plugin-1"))); assertFalse(Files.exists(pluginsPath.resolve("plugin-1.zip"))); assertTrue(repository.deletePluginPath(pluginsPath.resolve("plugin-3"))); assertFalse(repository.deletePluginPath(pluginsPath.resolve("plugin-4"))); List<Path> pluginPaths = repository.getPluginPaths(); assertEquals(1, pluginPaths.size()); assertEquals(pluginsPath.relativize(pluginPaths.get(0)).toString(), "plugin-2"); }