void writeZipEntry(ZipEntry entry, File destinationDir) { File file = new File(destinationDir, entry.getName()); FileOutputStream fos = new FileOutputStream(file); // BAD // ... write entry to fos ... }