return;
}
- // get all plugins paths from repository
- List<Path> pluginsPaths = pluginRepository.getPluginsPaths();
+ // get all plugin paths from repository
+ List<Path> pluginPaths = pluginRepository.getPluginPaths();
// check for no plugins
- if (pluginsPaths.isEmpty()) {
+ if (pluginPaths.isEmpty()) {
log.info("No plugins");
return;
}
- log.debug("Found {} possible plugins: {}", pluginsPaths.size(), pluginsPaths);
+ log.debug("Found {} possible plugins: {}", pluginPaths.size(), pluginPaths);
// load plugins from plugin paths
- for (Path pluginPath : pluginsPaths) {
+ for (Path pluginPath : pluginPaths) {
try {
loadPluginFromPath(pluginPath);
} catch (PluginException e) {
/**
* Set a {@link File} {@link Comparator} used to sort the listed files from {@code pluginsRoot}.
- * This comparator is used in {@link #getPluginsPaths()} method.
+ * This comparator is used in {@link #getPluginPaths()} method.
* By default is used a file comparator that returns the last modified files first.
* If you don't want a file comparator, then call this method with {@code null}.
*/
}
@Override
- public List<Path> getPluginsPaths() {
+ public List<Path> getPluginPaths() {
File[] files = pluginsRoot.toFile().listFiles(filter);
if ((files == null) || files.length == 0) {
}
@Override
- public List<Path> getPluginsPaths() {
+ public List<Path> getPluginPaths() {
Set<Path> paths = new LinkedHashSet<>();
for (PluginRepository repository : repositories) {
- paths.addAll(repository.getPluginsPaths());
+ paths.addAll(repository.getPluginPaths());
}
return new ArrayList<>(paths);
}
@Override
- public List<Path> getPluginsPaths() {
+ public List<Path> getPluginPaths() {
extractZipFiles();
- return super.getPluginsPaths();
+ return super.getPluginPaths();
}
@Override
public interface PluginRepository {
/**
- * List all plugins paths.
+ * List all plugin paths.
*
* @return a list with paths
*/
- List<Path> getPluginsPaths();
+ List<Path> getPluginPaths();
/**
* Removes a plugin from the repository.
}
/**
- * Test of {@link DefaultPluginRepository#getPluginsPaths()} method.
+ * Test of {@link DefaultPluginRepository#getPluginPaths()} method.
*/
@Test
public void testGetPluginArchives() {
PluginRepository repository = new DefaultPluginRepository(pluginsPath);
- List<Path> pluginsPaths = repository.getPluginsPaths();
+ List<Path> pluginPaths = repository.getPluginPaths();
- assertEquals(3, pluginsPaths.size());
- assertPathExists(pluginsPaths, pluginsPath.resolve("plugin-1"));
- assertPathExists(pluginsPaths, pluginsPath.resolve("plugin-2"));
- assertPathExists(pluginsPaths, pluginsPath.resolve("plugin-3"));
+ assertEquals(3, pluginPaths.size());
+ assertPathExists(pluginPaths, pluginsPath.resolve("plugin-1"));
+ assertPathExists(pluginPaths, pluginsPath.resolve("plugin-2"));
+ assertPathExists(pluginPaths, pluginsPath.resolve("plugin-3"));
}
/**
assertTrue(repository.deletePluginPath(pluginsPath.resolve("plugin-3")));
assertFalse(repository.deletePluginPath(pluginsPath.resolve("plugin-4")));
- List<Path> pluginsPaths = repository.getPluginsPaths();
+ List<Path> pluginPaths = repository.getPluginPaths();
- assertEquals(1, pluginsPaths.size());
- assertEquals(pluginsPath.relativize(pluginsPaths.get(0)).toString(), "plugin-2");
+ assertEquals(1, pluginPaths.size());
+ assertEquals(pluginsPath.relativize(pluginPaths.get(0)).toString(), "plugin-2");
}
private void assertPathExists(List<Path> paths, Path path) {
public void testGetPluginArchivesInDevelopmentMode() {
PluginRepository repository = new DevelopmentPluginRepository(pluginsPath);
- List<Path> pluginsPaths = repository.getPluginsPaths();
+ List<Path> pluginPaths = repository.getPluginPaths();
// target and build should be ignored
- assertEquals(0, pluginsPaths.size());
- assertPathDoesNotExists(pluginsPaths, pluginsPath.resolve(DevelopmentPluginRepository.MAVEN_BUILD_DIR));
- assertPathDoesNotExists(pluginsPaths, pluginsPath.resolve(DevelopmentPluginRepository.GRADLE_BUILD_DIR));
+ assertEquals(0, pluginPaths.size());
+ assertPathDoesNotExists(pluginPaths, pluginsPath.resolve(DevelopmentPluginRepository.MAVEN_BUILD_DIR));
+ assertPathDoesNotExists(pluginPaths, pluginsPath.resolve(DevelopmentPluginRepository.GRADLE_BUILD_DIR));
}
private void assertPathDoesNotExists(List<Path> paths, Path path) {
assertFalse(repository.deletePluginPath(plugin1Path));
- List<Path> pluginsPaths = repository.getPluginsPaths();
- assertEquals(1, pluginsPaths.size());
+ List<Path> pluginPaths = repository.getPluginPaths();
+ assertEquals(1, pluginPaths.size());
assertTrue(repository.deletePluginPath(plugin1JarPath));
- pluginsPaths = repository.getPluginsPaths();
- assertEquals(0, pluginsPaths.size());
+ pluginPaths = repository.getPluginPaths();
+ assertEquals(0, pluginPaths.size());
}
}