* a requested resource can not be found in the main context.
*/
public void addResourcesJar(URL url) {
- JarFile jarFile = null;
try {
JarURLConnection conn = (JarURLConnection) url.openConnection();
- jarFile = conn.getJarFile();
+ JarFile jarFile = conn.getJarFile();
ZipEntry entry = jarFile.getEntry("/");
WARDirContext warDirContext = new WARDirContext(jarFile,
new WARDirContext.Entry("/", entry));
altDirContexts.add(warDirContext);
} catch (IOException ioe) {
log.warn(sm.getString("resources.addResourcesJarFail", url), ioe);
- } finally {
- if (jarFile != null) {
- try {
- jarFile.close();
- } catch (IOException e) {
- // Ignore
- }
- }
}
}