summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Ruocco <michael.ruocco@hotmail.com>2018-12-03 06:34:38 +0000
committerDecebal Suiu <decebal.suiu@gmail.com>2018-12-03 08:34:38 +0200
commit7d045578409ef2a65ced46a11ecd05b372f41a67 (patch)
tree930fee58e905f677b9d5656fcac098799fd8dc96
parenta6eeceddbf1961a28236cde1d56951efbb17339d (diff)
downloadpf4j-7d045578409ef2a65ced46a11ecd05b372f41a67.tar.gz
pf4j-7d045578409ef2a65ced46a11ecd05b372f41a67.zip
Adds ability to configure plugin directory (#256)
-rw-r--r--pf4j/src/main/java/org/pf4j/DefaultPluginManager.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/pf4j/src/main/java/org/pf4j/DefaultPluginManager.java b/pf4j/src/main/java/org/pf4j/DefaultPluginManager.java
index 01f0f28..c1a695f 100644
--- a/pf4j/src/main/java/org/pf4j/DefaultPluginManager.java
+++ b/pf4j/src/main/java/org/pf4j/DefaultPluginManager.java
@@ -21,6 +21,7 @@ import org.slf4j.LoggerFactory;
import java.io.File;
import java.nio.file.Path;
+import java.nio.file.Paths;
/**
* Default implementation of the {@link PluginManager} interface.
@@ -78,7 +79,9 @@ public class DefaultPluginManager extends AbstractPluginManager {
@Override
protected PluginStatusProvider createPluginStatusProvider() {
- return new DefaultPluginStatusProvider(getPluginsRoot());
+ String configDir = System.getProperty("pf4j.pluginsConfigDir");
+ Path configPath = configDir != null ? Paths.get(configDir) : getPluginsRoot();
+ return new DefaultPluginStatusProvider(configPath);
}
@Override