diff options
author | Hao Xiang <haoxiangzhao@outlook.com> | 2018-01-23 18:31:45 +0800 |
---|---|---|
committer | Decebal Suiu <decebal.suiu@gmail.com> | 2018-01-23 12:31:45 +0200 |
commit | e80aae6c1f613c8248e7161c7d83c66109f2a7d5 (patch) | |
tree | 78926680b4da108e1e7ba856c1957e1937a7a7ec /pf4j/src | |
parent | a78fe6d7e6d9b11c2f2d8360ddf2d9cc13be7e8b (diff) | |
download | pf4j-e80aae6c1f613c8248e7161c7d83c66109f2a7d5.tar.gz pf4j-e80aae6c1f613c8248e7161c7d83c66109f2a7d5.zip |
close JarFile stream after getManifest (#197)
Diffstat (limited to 'pf4j/src')
-rw-r--r-- | pf4j/src/main/java/org/pf4j/ManifestPluginDescriptorFinder.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pf4j/src/main/java/org/pf4j/ManifestPluginDescriptorFinder.java b/pf4j/src/main/java/org/pf4j/ManifestPluginDescriptorFinder.java index e2bac20..47f4d72 100644 --- a/pf4j/src/main/java/org/pf4j/ManifestPluginDescriptorFinder.java +++ b/pf4j/src/main/java/org/pf4j/ManifestPluginDescriptorFinder.java @@ -51,8 +51,8 @@ public class ManifestPluginDescriptorFinder implements PluginDescriptorFinder { protected Manifest readManifest(Path pluginPath) throws PluginException { if (FileUtils.isJarFile(pluginPath)) { - try { - Manifest manifest = new JarFile(pluginPath.toFile()).getManifest(); + try(JarFile jar = new JarFile(pluginPath.toFile())) { + Manifest manifest = jar.getManifest(); if (manifest != null) { return manifest; } |