X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;ds=sidebyside;f=org.argeo.slc.core%2Fsrc%2Forg%2Fargeo%2Fslc%2Fosgi%2FFileSystemBundleRegister.java;h=03f21c5304e2217530fb9181bb046ad382454178;hb=0d17b16f0082b7404009354544ea0b9c71b48f48;hp=a068a4f8c65e0a5226591502e44f544ba9c06bf2;hpb=805e3301575e708491482a2a00dd37bc2b41b851;p=gpl%2Fargeo-slc.git diff --git a/org.argeo.slc.core/src/org/argeo/slc/osgi/FileSystemBundleRegister.java b/org.argeo.slc.core/src/org/argeo/slc/osgi/FileSystemBundleRegister.java index a068a4f8c..03f21c530 100644 --- a/org.argeo.slc.core/src/org/argeo/slc/osgi/FileSystemBundleRegister.java +++ b/org.argeo.slc.core/src/org/argeo/slc/osgi/FileSystemBundleRegister.java @@ -22,6 +22,7 @@ import java.util.Set; import java.util.jar.JarFile; import java.util.jar.Manifest; +import org.apache.commons.io.IOUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.osgi.framework.Constants; @@ -50,8 +51,9 @@ public class FileSystemBundleRegister implements BundleRegister { if (file.isDirectory()) { } else { + JarFile jarFile = null; try { - JarFile jarFile = new JarFile(file); + jarFile = new JarFile(file); Manifest manifest = jarFile.getManifest(); String symbolicName = manifest.getMainAttributes() .getValue(Constants.BUNDLE_SYMBOLICNAME); @@ -73,6 +75,8 @@ public class FileSystemBundleRegister implements BundleRegister { log.warn("Cannot scan " + file, e); if (log.isTraceEnabled()) e.printStackTrace(); + } finally { + IOUtils.closeQuietly(jarFile); } } }