Browse Source

close JarFile stream after getManifest (#197)

pull/205/head
Hao Xiang 7 years ago committed by Decebal Suiu
parent
commit
e80aae6c1f
  1. 4
      pf4j/src/main/java/org/pf4j/ManifestPluginDescriptorFinder.java

4
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;
}

Loading…
Cancel
Save