tempFile.deleteOnExit(); // just in case we crash before the codebase is closed
inputStream = parentCodeBase.lookupResource(resourceName).openResource();
outputStream = new BufferedOutputStream(new FileOutputStream(tempFile));
IO.copy(inputStream, outputStream);
outputStream.flush();
<BUG>delegateCodeBase = new ZipFileCodeBase(codeBaseLocator, tempFile);
</BUG>
} finally {
if (inputStream != null) {
IO.close(inputStream);

tempFile.deleteOnExit(); // just in case we crash before the codebase is closed
inputStream = parentCodeBase.lookupResource(resourceName).openResource();
outputStream = new BufferedOutputStream(new FileOutputStream(tempFile));
IO.copy(inputStream, outputStream);
outputStream.flush();
delegateCodeBase = ZipCodeBaseFactory.makeZipCodeBase(codeBaseLocator, tempFile);
} finally {
if (inputStream != null) {
IO.close(inputStream);
