From: Decebal Suiu Date: Mon, 13 May 2019 17:37:56 +0000 (+0300) Subject: Revert commit 40846fa (Rename PluginRepository.getPluginPaths to getPluginsPaths) X-Git-Tag: release-3.0.0~2^2~11 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3cd26fc19d3511477870ad797a9de52bf99fef0a;p=pf4j.git Revert commit 40846fa (Rename PluginRepository.getPluginPaths to getPluginsPaths) --- diff --git a/pf4j/src/main/java/org/pf4j/AbstractPluginManager.java b/pf4j/src/main/java/org/pf4j/AbstractPluginManager.java index b6b4741..6039b51 100644 --- a/pf4j/src/main/java/org/pf4j/AbstractPluginManager.java +++ b/pf4j/src/main/java/org/pf4j/AbstractPluginManager.java @@ -207,19 +207,19 @@ public abstract class AbstractPluginManager implements PluginManager { return; } - // get all plugins paths from repository - List pluginsPaths = pluginRepository.getPluginsPaths(); + // get all plugin paths from repository + List 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) { diff --git a/pf4j/src/main/java/org/pf4j/BasePluginRepository.java b/pf4j/src/main/java/org/pf4j/BasePluginRepository.java index b083994..64c996b 100644 --- a/pf4j/src/main/java/org/pf4j/BasePluginRepository.java +++ b/pf4j/src/main/java/org/pf4j/BasePluginRepository.java @@ -57,7 +57,7 @@ public class BasePluginRepository implements PluginRepository { /** * 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}. */ @@ -66,7 +66,7 @@ public class BasePluginRepository implements PluginRepository { } @Override - public List getPluginsPaths() { + public List getPluginPaths() { File[] files = pluginsRoot.toFile().listFiles(filter); if ((files == null) || files.length == 0) { diff --git a/pf4j/src/main/java/org/pf4j/CompoundPluginRepository.java b/pf4j/src/main/java/org/pf4j/CompoundPluginRepository.java index aef714c..600f00c 100644 --- a/pf4j/src/main/java/org/pf4j/CompoundPluginRepository.java +++ b/pf4j/src/main/java/org/pf4j/CompoundPluginRepository.java @@ -56,10 +56,10 @@ public class CompoundPluginRepository implements PluginRepository { } @Override - public List getPluginsPaths() { + public List getPluginPaths() { Set paths = new LinkedHashSet<>(); for (PluginRepository repository : repositories) { - paths.addAll(repository.getPluginsPaths()); + paths.addAll(repository.getPluginPaths()); } return new ArrayList<>(paths); diff --git a/pf4j/src/main/java/org/pf4j/DefaultPluginRepository.java b/pf4j/src/main/java/org/pf4j/DefaultPluginRepository.java index f50a231..70a4bb9 100644 --- a/pf4j/src/main/java/org/pf4j/DefaultPluginRepository.java +++ b/pf4j/src/main/java/org/pf4j/DefaultPluginRepository.java @@ -48,9 +48,9 @@ public class DefaultPluginRepository extends BasePluginRepository { } @Override - public List getPluginsPaths() { + public List getPluginPaths() { extractZipFiles(); - return super.getPluginsPaths(); + return super.getPluginPaths(); } @Override diff --git a/pf4j/src/main/java/org/pf4j/PluginRepository.java b/pf4j/src/main/java/org/pf4j/PluginRepository.java index 941d68f..9b4298a 100644 --- a/pf4j/src/main/java/org/pf4j/PluginRepository.java +++ b/pf4j/src/main/java/org/pf4j/PluginRepository.java @@ -27,11 +27,11 @@ import java.util.List; public interface PluginRepository { /** - * List all plugins paths. + * List all plugin paths. * * @return a list with paths */ - List getPluginsPaths(); + List getPluginPaths(); /** * Removes a plugin from the repository. diff --git a/pf4j/src/test/java/org/pf4j/DefaultPluginRepositoryTest.java b/pf4j/src/test/java/org/pf4j/DefaultPluginRepositoryTest.java index 2237dfe..3474aa6 100644 --- a/pf4j/src/test/java/org/pf4j/DefaultPluginRepositoryTest.java +++ b/pf4j/src/test/java/org/pf4j/DefaultPluginRepositoryTest.java @@ -49,18 +49,18 @@ public class DefaultPluginRepositoryTest { } /** - * Test of {@link DefaultPluginRepository#getPluginsPaths()} method. + * Test of {@link DefaultPluginRepository#getPluginPaths()} method. */ @Test public void testGetPluginArchives() { PluginRepository repository = new DefaultPluginRepository(pluginsPath); - List pluginsPaths = repository.getPluginsPaths(); + List 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")); } /** @@ -76,10 +76,10 @@ public class DefaultPluginRepositoryTest { assertTrue(repository.deletePluginPath(pluginsPath.resolve("plugin-3"))); assertFalse(repository.deletePluginPath(pluginsPath.resolve("plugin-4"))); - List pluginsPaths = repository.getPluginsPaths(); + List 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 paths, Path path) { diff --git a/pf4j/src/test/java/org/pf4j/DevelopmentPluginRepositoryTest.java b/pf4j/src/test/java/org/pf4j/DevelopmentPluginRepositoryTest.java index 9e4c8da..20d9129 100644 --- a/pf4j/src/test/java/org/pf4j/DevelopmentPluginRepositoryTest.java +++ b/pf4j/src/test/java/org/pf4j/DevelopmentPluginRepositoryTest.java @@ -46,12 +46,12 @@ public class DevelopmentPluginRepositoryTest { public void testGetPluginArchivesInDevelopmentMode() { PluginRepository repository = new DevelopmentPluginRepository(pluginsPath); - List pluginsPaths = repository.getPluginsPaths(); + List 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 paths, Path path) { diff --git a/pf4j/src/test/java/org/pf4j/JarPluginRepositoryTest.java b/pf4j/src/test/java/org/pf4j/JarPluginRepositoryTest.java index 02d2bcc..4501223 100644 --- a/pf4j/src/test/java/org/pf4j/JarPluginRepositoryTest.java +++ b/pf4j/src/test/java/org/pf4j/JarPluginRepositoryTest.java @@ -46,13 +46,13 @@ public class JarPluginRepositoryTest { assertFalse(repository.deletePluginPath(plugin1Path)); - List pluginsPaths = repository.getPluginsPaths(); - assertEquals(1, pluginsPaths.size()); + List 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()); } }