aboutsummaryrefslogtreecommitdiffstats
path: root/pf4j/src
diff options
context:
space:
mode:
authorDecebal Suiu <decebal.suiu@gmail.com>2019-04-14 00:06:47 +0300
committerDecebal Suiu <decebal.suiu@gmail.com>2019-04-14 00:06:47 +0300
commit40846fa1864da287690ef01402d5b5ccccbf351f (patch)
tree83a3e04e067f51c2d248d1acff803df684340cfb /pf4j/src
parentc1062e7cc77a87068ce63e0443524da98bc0ae64 (diff)
downloadpf4j-40846fa1864da287690ef01402d5b5ccccbf351f.tar.gz
pf4j-40846fa1864da287690ef01402d5b5ccccbf351f.zip
Rename PluginRepository.getPluginPaths to getPluginsPaths
Diffstat (limited to 'pf4j/src')
-rw-r--r--pf4j/src/main/java/org/pf4j/AbstractPluginManager.java10
-rw-r--r--pf4j/src/main/java/org/pf4j/BasePluginRepository.java4
-rw-r--r--pf4j/src/main/java/org/pf4j/CompoundPluginRepository.java4
-rw-r--r--pf4j/src/main/java/org/pf4j/DefaultPluginRepository.java4
-rw-r--r--pf4j/src/main/java/org/pf4j/PluginRepository.java8
-rw-r--r--pf4j/src/test/java/org/pf4j/DefaultPluginRepositoryTest.java30
6 files changed, 30 insertions, 30 deletions
diff --git a/pf4j/src/main/java/org/pf4j/AbstractPluginManager.java b/pf4j/src/main/java/org/pf4j/AbstractPluginManager.java
index 5803a62..33130a3 100644
--- a/pf4j/src/main/java/org/pf4j/AbstractPluginManager.java
+++ b/pf4j/src/main/java/org/pf4j/AbstractPluginManager.java
@@ -200,19 +200,19 @@ public abstract class AbstractPluginManager implements PluginManager {
return;
}
- // get all plugin paths from repository
- List<Path> pluginPaths = pluginRepository.getPluginPaths();
+ // get all plugins paths from repository
+ List<Path> pluginsPaths = pluginRepository.getPluginsPaths();
// check for no plugins
- if (pluginPaths.isEmpty()) {
+ if (pluginsPaths.isEmpty()) {
log.info("No plugins");
return;
}
- log.debug("Found {} possible plugins: {}", pluginPaths.size(), pluginPaths);
+ log.debug("Found {} possible plugins: {}", pluginsPaths.size(), pluginsPaths);
// load plugins from plugin paths
- for (Path pluginPath : pluginPaths) {
+ for (Path pluginPath : pluginsPaths) {
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 381059c..0bf6e6c 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 #getPluginPaths()} method.
+ * This comparator is used in {@link #getPluginsPaths()} 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<Path> getPluginPaths() {
+ public List<Path> getPluginsPaths() {
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 09bc5ce..705b912 100644
--- a/pf4j/src/main/java/org/pf4j/CompoundPluginRepository.java
+++ b/pf4j/src/main/java/org/pf4j/CompoundPluginRepository.java
@@ -38,10 +38,10 @@ public class CompoundPluginRepository implements PluginRepository {
}
@Override
- public List<Path> getPluginPaths() {
+ public List<Path> getPluginsPaths() {
List<Path> paths = new ArrayList<>();
for (PluginRepository repository : repositories) {
- paths.addAll(repository.getPluginPaths());
+ paths.addAll(repository.getPluginsPaths());
}
return paths;
diff --git a/pf4j/src/main/java/org/pf4j/DefaultPluginRepository.java b/pf4j/src/main/java/org/pf4j/DefaultPluginRepository.java
index 78ea43c..6bc8d49 100644
--- a/pf4j/src/main/java/org/pf4j/DefaultPluginRepository.java
+++ b/pf4j/src/main/java/org/pf4j/DefaultPluginRepository.java
@@ -48,7 +48,7 @@ public class DefaultPluginRepository extends BasePluginRepository {
}
@Override
- public List<Path> getPluginPaths() {
+ public List<Path> getPluginsPaths() {
// expand plugins zip files
File[] pluginZips = pluginsRoot.toFile().listFiles(new ZipFileFilter());
if ((pluginZips != null) && pluginZips.length > 0) {
@@ -62,7 +62,7 @@ public class DefaultPluginRepository extends BasePluginRepository {
}
}
- return super.getPluginPaths();
+ return super.getPluginsPaths();
}
@Override
diff --git a/pf4j/src/main/java/org/pf4j/PluginRepository.java b/pf4j/src/main/java/org/pf4j/PluginRepository.java
index f3617cd..d0b2125 100644
--- a/pf4j/src/main/java/org/pf4j/PluginRepository.java
+++ b/pf4j/src/main/java/org/pf4j/PluginRepository.java
@@ -19,7 +19,7 @@ import java.nio.file.Path;
import java.util.List;
/**
- * Directory that contains plugins. A plugin could be a zip file.
+ * Directory that contains plugins. A plugin could be a {@code directory}, @code zip} or {@code jar} file.
*
* @author Decebal Suiu
* @author Mário Franco
@@ -27,11 +27,11 @@ import java.util.List;
public interface PluginRepository {
/**
- * List all plugin paths.
+ * List all plugins paths.
*
- * @return a list of files
+ * @return a list with paths
*/
- List<Path> getPluginPaths();
+ List<Path> getPluginsPaths();
/**
* 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 4f13bac..3aaba8f 100644
--- a/pf4j/src/test/java/org/pf4j/DefaultPluginRepositoryTest.java
+++ b/pf4j/src/test/java/org/pf4j/DefaultPluginRepositoryTest.java
@@ -52,33 +52,33 @@ public class DefaultPluginRepositoryTest {
}
/**
- * Test of {@link DefaultPluginRepository#getPluginPaths()} method.
+ * Test of {@link DefaultPluginRepository#getPluginsPaths()} method.
*/
@Test
public void testGetPluginArchives() {
PluginRepository repository = new DefaultPluginRepository(pluginsPath, false);
- List<Path> pluginPaths = repository.getPluginPaths();
+ List<Path> pluginsPaths = repository.getPluginsPaths();
- assertEquals(5, pluginPaths.size());
- assertPathExists(pluginPaths, pluginsPath.resolve("plugin-1"));
- assertPathExists(pluginPaths, pluginsPath.resolve("plugin-2"));
- assertPathExists(pluginPaths, pluginsPath.resolve("plugin-3"));
+ assertEquals(5, pluginsPaths.size());
+ assertPathExists(pluginsPaths, pluginsPath.resolve("plugin-1"));
+ assertPathExists(pluginsPaths, pluginsPath.resolve("plugin-2"));
+ assertPathExists(pluginsPaths, pluginsPath.resolve("plugin-3"));
// when not in development mode we will honor these folders
- assertPathExists(pluginPaths, pluginsPath.resolve("target"));
- assertPathExists(pluginPaths, pluginsPath.resolve("build"));
+ assertPathExists(pluginsPaths, pluginsPath.resolve("target"));
+ assertPathExists(pluginsPaths, pluginsPath.resolve("build"));
}
@Test
public void testGetPluginArchivesInDevelopmentMode() {
PluginRepository repository = new DefaultPluginRepository(pluginsPath, true);
- List<Path> pluginPaths = repository.getPluginPaths();
+ List<Path> pluginsPaths = repository.getPluginsPaths();
// target and build should be ignored
- assertEquals(3, pluginPaths.size());
- assertPathDoesNotExists(pluginPaths, pluginsPath.resolve("target"));
- assertPathDoesNotExists(pluginPaths, pluginsPath.resolve("build"));
+ assertEquals(3, pluginsPaths.size());
+ assertPathDoesNotExists(pluginsPaths, pluginsPath.resolve("target"));
+ assertPathDoesNotExists(pluginsPaths, pluginsPath.resolve("build"));
}
/**
@@ -96,10 +96,10 @@ public class DefaultPluginRepositoryTest {
assertTrue(repository.deletePluginPath(pluginsPath.resolve("target")));
assertTrue(repository.deletePluginPath(pluginsPath.resolve("build")));
- List<Path> pluginPaths = repository.getPluginPaths();
+ List<Path> pluginsPaths = repository.getPluginsPaths();
- assertEquals(1, pluginPaths.size());
- assertEquals(pluginsPath.relativize(pluginPaths.get(0)).toString(), "plugin-2");
+ assertEquals(1, pluginsPaths.size());
+ assertEquals(pluginsPath.relativize(pluginsPaths.get(0)).toString(), "plugin-2");
}
private void assertPathExists(List<Path> paths, Path path) {