backport to work with java6
@@ -61,10 +61,11 @@ public class MultiReleaseContent implements Content
}
if (javaVersion > 8)
{
+ InputStream manifestStream = null;
+
try
{
- try (InputStream manifestStream = content.getEntryAsStream("META-INF/MANIFEST.MF"))
- {
+ manifestStream = content.getEntryAsStream("META-INF/MANIFEST.MF");
if (manifestStream != null)
{
if ("true".equals(new Manifest(manifestStream).getMainAttributes().getValue("Multi-Release")))
@@ -73,10 +74,20 @@ public class MultiReleaseContent implements Content
}
}
}
- }
catch (Exception ex)
{
}
+ finally
+ {
+ if (manifestStream != null)
+ {
+ try
+ {
+ manifestStream.close();
+ }
+ catch (Exception ex){}
+ }
+ }
}
return content;
}
