As i understand it, if getEntry() throws an exception, the finally clause will be executed and the zip file will be closed, the exception will be rethrown and the outer catch will catch it. The outer catch also handles exceptions thrown by the constructor of the ZipFile. I cannot put the finally clause on the outer try, because the zipFile variable cannot be resolved from there.