diff options
author | Decebal Suiu <decebal.suiu@gmail.com> | 2019-04-15 20:51:20 +0300 |
---|---|---|
committer | Decebal Suiu <decebal.suiu@gmail.com> | 2019-04-15 20:51:20 +0300 |
commit | d10b0a944741c627db5064bdf181ba93d8324b6c (patch) | |
tree | 26f2d03edb0f91ecf5b1fc073b50e88c946cbf2e | |
parent | 70963ea174976051d586f0bb2829596de1c507b7 (diff) | |
download | pf4j-d10b0a944741c627db5064bdf181ba93d8324b6c.tar.gz pf4j-d10b0a944741c627db5064bdf181ba93d8324b6c.zip |
Improve readability
-rw-r--r-- | pf4j/src/main/java/org/pf4j/DefaultPluginRepository.java | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/pf4j/src/main/java/org/pf4j/DefaultPluginRepository.java b/pf4j/src/main/java/org/pf4j/DefaultPluginRepository.java index 6bc8d49..da456eb 100644 --- a/pf4j/src/main/java/org/pf4j/DefaultPluginRepository.java +++ b/pf4j/src/main/java/org/pf4j/DefaultPluginRepository.java @@ -49,19 +49,7 @@ public class DefaultPluginRepository extends BasePluginRepository { @Override public List<Path> getPluginsPaths() { - // expand plugins zip files - File[] pluginZips = pluginsRoot.toFile().listFiles(new ZipFileFilter()); - if ((pluginZips != null) && pluginZips.length > 0) { - for (File pluginZip : pluginZips) { - try { - FileUtils.expandIfZip(pluginZip.toPath()); - } catch (IOException e) { - log.error("Cannot expand plugin zip '{}'", pluginZip); - log.error(e.getMessage(), e); - } - } - } - + extractZipFiles(); return super.getPluginsPaths(); } @@ -83,4 +71,20 @@ public class DefaultPluginRepository extends BasePluginRepository { return hiddenPluginFilter; } + + private void extractZipFiles() { + // expand plugins zip files + File[] zipFiles = pluginsRoot.toFile().listFiles(new ZipFileFilter()); + if ((zipFiles != null) && zipFiles.length > 0) { + for (File pluginZip : zipFiles) { + try { + FileUtils.expandIfZip(pluginZip.toPath()); + } catch (IOException e) { + log.error("Cannot expand plugin zip '{}'", pluginZip); + log.error(e.getMessage(), e); + } + } + } + } + } |