From da346cf715b98560120fd2b3c531199f3ff58d37 Mon Sep 17 00:00:00 2001 From: Decebal Suiu Date: Wed, 27 Sep 2017 21:36:29 +0300 Subject: [PATCH] Open a new extension (protected method) point in PropertiesPluginDescriptorFinder --- .../java/org/pf4j/PropertiesPluginDescriptorFinder.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pf4j/src/main/java/org/pf4j/PropertiesPluginDescriptorFinder.java b/pf4j/src/main/java/org/pf4j/PropertiesPluginDescriptorFinder.java index 0391bce..31d4d53 100644 --- a/pf4j/src/main/java/org/pf4j/PropertiesPluginDescriptorFinder.java +++ b/pf4j/src/main/java/org/pf4j/PropertiesPluginDescriptorFinder.java @@ -55,10 +55,10 @@ public class PropertiesPluginDescriptorFinder implements PluginDescriptorFinder } protected Properties readProperties(Path pluginPath) throws PluginException { - Path propertiesPath = pluginPath.resolve(Paths.get(propertiesFileName)); + Path propertiesPath = getPropertiesPath(pluginPath, propertiesFileName); log.debug("Lookup plugin descriptor in '{}'", propertiesPath); if (Files.notExists(propertiesPath)) { - throw new PluginException("Cannot find '{}' path", pluginPath); + throw new PluginException("Cannot find '{}' path", propertiesPath); } Properties properties = new Properties(); @@ -71,6 +71,10 @@ public class PropertiesPluginDescriptorFinder implements PluginDescriptorFinder return properties; } + protected Path getPropertiesPath(Path pluginPath, String propertiesFileName) throws PluginException { + return pluginPath.resolve(Paths.get(propertiesFileName)); + } + protected PluginDescriptor createPluginDescriptor(Properties properties) { PluginDescriptor pluginDescriptor = createPluginDescriptorInstance();